int yBody = 0;
void OnGUI(){
yBody = 0;
InvWindow =GUI.Window (0, InvWindow, InvFunc, "inventory");
}
void InvFunc(int windowID){
if (GUI.Button (new Rect (150, 50, 20, 20), "-") ) {//this one works
Debug.Log("x is 150");
bodyBut[(byte)body.torso] = !bodyBut[(byte)body.torso];
}
if I write yBody for anything else like 100 it works
if (GUI.Button (new Rect (80, yBody, 20, 20), "-") ) {//this one don't work any more
Debug.Log("x is 80");
bodyBut[(byte)body.torso] = !bodyBut[(byte)body.torso];
}
so the question is how do I write more buttons like [here][1] the yBody is changing for each button, ...
[1]: https://rextester.com/NZBBV71133
↧