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

"ToggleActive()" callback function for UI components?

$
0
0
I found it severely inconvenient that UI components do not have a "ToggleActive()" method.

Let's say you want to implement a button that toggles some other UI component's visibility state. You would have to prepare two buttons on the top of each other, assigning callbacks like this:

Button1:
Something.SetActive(true)
Button1.SetActive(false)
Button2.SetActive(true)
Button2:
Something.SetActive(false)
Button2.SetActive(false)
Button1.SetActive(true)

Or write a script that...

"ToggleActive()" callback function for UI components?

Viewing all articles
Browse latest Browse all 23263

Trending Articles



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