Hello!
I’ve small problem with adding boolean array variable to GUI.Toggle…
“IndexOutOfRangeException: Array index is out of range”
Here’s the code:
#pragma strict
var texturequality : boolean[] = new boolean[4];
function Start(){ //deleting this doesn't help
texturequality[0] = true;
texturequality[1] = false;
texturequality[2] = false;
texturequality[3] = false;
}
function OnGUI(){
texturequality[0] = GUI.Toggle(Rect(Screen.width/1.5-60,Screen.height/8.5+20,14,20),texturequality[0],"");
texturequality[1] = GUI.Toggle(Rect(Screen.width/1.5-30,Screen.height/8.5+20,14,20),texturequality[1],"");
texturequality[2] = GUI.Toggle(Rect(Screen.width/1.5,Screen.height/8.5+20,14,20),texturequality[2],"");
texturequality[3] = GUI.Toggle(Rect(Screen.width/1.5+30,Screen.height/8.5+20,14,20),texturequality[3],"");
}
Any help?