Quantcast
Channel: Questions in topic: "gui"
Viewing all articles
Browse latest Browse all 125

buttons don't work if I use int

$
0
0
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

Viewing all articles
Browse latest Browse all 125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>