Hello guys!
I was trying to do one thing, but i couldn’t.
Something like, when i press on button in one script this button changes the state of one bool variable in other script,
if(createButton(620, 500, 100, 30, "Confirm")) {
Instruments.showContentInstrument = true;
}
The variable in the other script it’s obviously static! And about the createButton(it is a method that i created, corresponding GUI.Button(new Rect…), “”);
I wanna to press the button and change the state, and in the other script he will verify if the bool variable is true, like this:
if(showContentInstrument == true) {
if(createButton(620, 400, 100, 30, "Trompete")) {
trompClicked = true;
}
Thanks to all that will help =).
yea, i did that!
– RafaelCNPlease post comments by pressing the 'add new comment' button, not by posting a new answer. Great! So your code looks good to me (except checking that a bool is == true). Does your second button show up like it's supposed to? You don't really state what problem you're having is, only what your intended behavior is.
– iwaldropRyan, this will (obviously) prevent the last frame from clearing, plus the background will start as black. Most people most likely don't want this behavior.
– clabe45