function OnGUI() {
print(""+boxselecting);
if(boxselecting){
var width : int = leftupbox.x - rightdownbox.x;
var height : int = (Screen.height - leftupbox.y) - (Screen.height - rightdownbox.y);
var rect : Rect = Rect(rightdownbox.x, Screen.height - rightdownbox.y, width, height);
//GUI.Box(rect, "Its ALIVE");
GUI.Box(Rect(rightdownbox.x, Screen.height - rightdownbox.y, width, height), "Its ALIVE");
//GUI.DrawTexture(rect, selectionTexture, ScaleMode.StretchToFill, true, 10.0f);
print("GUI");
}
}
this is my code for drawing a box and unity gives me the GUI can only be called in OnGUI error whats wrong with my code?