Hi there. I have a huge ( +100 elements ) array, and every part of it have different GUIStyle implemented at the beginning. I tried to make a loop which displays all of these elements as a toggles on screen with a loop. Everything works good, except for the one thing : i got problems with >Unable to find style ‘XH’ in skin ‘GameSkin’ Repaint< Error. My loop looks like that :
for (var i = 1; i <= 50; i=i+4){
tx[i] = GUI.Toggle(Rect(0, (b-1)*68, 60, 60), tx[i], "",Namelist.names[i]);
tx[i+1] = GUI.Toggle(Rect(68,(b-1)*68, 60, 60), tx[i+1], "",Namelist.names[i+1]);
tx[i+2] = GUI.Toggle(Rect(136,(b-1)*68, 60, 60), tx[i+2], "",Namelist.names[i+2]);
tx[i+3] = GUI.Toggle(Rect(204,(b-1)*68, 60, 60), tx[i+3], "",Namelist.names[i+3]);
b++;
}
In other script named Namelist, i got this array ( names[125] ), which have implemented strings ( names[1] =“bobby” ). This array is static var. Also, in script, where this loop is located, i have implemented styles this way :
var bobby : GUIStyle;
The problem is, i got this error. The funny part is that if i manually write guistyle name in this loop, it works !
tx[i] = GUI.Toggle(Rect(0, (b-1)*68, 60, 60), tx[i], "",bobby);
Just like this. But this array is huge, so writing manually +100 positions is bad idea i guess… I dont know what to do, but there is alittle clue : when I write manually guistyle name, but with quotation marks, the program things its GUISkin, and automatically it throws same error, like with my loop->array system ! I mean like this :
tx[i] = GUI.Toggle(Rect(0, (b-1)*68, 60, 60), tx[i], "","bobby");
So is there any way to work this one out ? ![]()