Holla, i’ve try to do some code, and with my not-so-good-algorithm-brain it comes up on a dead end… so, here’s my code.
#pragma strict
var images : Texture2D[];
function OnGUI () {
var i : int;
GUI.DrawTexture(Rect(200,50,100,100),images*);*
- if(GUI.Button(new Rect(210,300,100,50),“next texture”)){*
-
print(i);*
-
i++;*
_ GUI.DrawTexture(Rect(200,50,100,100), images*);_
_ print(i);_
_ }_
_ if(GUI.Button(new Rect(100,300,100,50),“previous texture”)){_
_ i–;_
_ GUI.DrawTexture(Rect(200,50,100,100), images);
print(i);*_
* }*
}
i know that my code is so lame, and weird… *haha
but i think i need something like to repaint the gui drawtexture… the i always saying 1 and 0 only, everytime i press Next texture button, it shows up 0 and 1, then press it again, 0 and 1 again… doesn;t the counter should go up? or because i put the var and GUI.DrawTexture on the top of the if’s? Thanks for further help, some poniter will be appreciated