Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

How Do I get A reference To A Button

$
0
0
In my canvas I have 4 buttons. When I click the first button I want to make 2 of the other buttons to become invisible. My script is on the canvas and all the onClick functions are in that script. So How can I get a reference to some specific buttons on that canvas so I can disable them? I am assuming I just set enable = false once I get the reference, but I don't know how to get the reference.

EDIT:
currently I am using FindGameObjectWithTag but then I have to create tags for every object....

How Do I get A reference To A Button

Viewing all articles
Browse latest Browse all 23263

Trending Articles



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