x


Is there a way of using just basic gui.Buttons as toggles?

I have this script here:

if (GUI.Button (Rect (Screen.width - (Screen.width - 10),Screen.height - 70,60,60),"Monsters") || Input.GetKeyUp("v")){
       showMonsterButtons = true;

       }

that i want the showMonsterButtons to be false when i click it again. how would i do this?

more ▼

asked Nov 05 '11 at 03:47 PM

IMTRIGGERHAPPY9 gravatar image

IMTRIGGERHAPPY9
134 40 46 47

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

is this what you mean?

if (GUI.Button (Rect (Screen.width - (Screen.width - 10),Screen.height - 70,6
0,60),"Monsters") || Input.GetKeyUp("v")){
           if(showMonsterButtons) showMonsterButtons = false;
           else showMonsterButtons = true;


           }
more ▼

answered Nov 05 '11 at 03:49 PM

Catlard gravatar image

Catlard
641 64 70 73

wow.... ha ha i wasn't even thinking along those lines! thank you for pointing it out! i feel like such a noob now ha ha ha

Nov 05 '11 at 03:52 PM IMTRIGGERHAPPY9

no worries!

Nov 05 '11 at 03:55 PM Catlard
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5085
x1130
x217

asked: Nov 05 '11 at 03:47 PM

Seen: 994 times

Last Updated: Nov 05 '11 at 03:55 PM