I’m making an HUD with the new GUI system on version 5. There are various attack buttons that are disabled initially until you press one toggle button which will enable them.
I have two questions really:
Can this be done inside the editor as with making the buttons? Or should it be done through coding?
I thought maybe the toggle group would be the answer, but I was mistaken.
If it it to be in code, does anyone have some thoughts on how to do it?
Thanks!
Your button has by default a Button Script. At the bottom of this component there is an OnClick(). You have to create a script and attach it to any gameobject so that it is running. In that custom script you have to have a GameObject that you assign to this panel you want to show/hide. Then you have a public void that toggles this panel
(ie. panel.SetActive(true/false);).
Then on the button in the OnClick() section you press the + button, select the gameobject that has your custom script, and then with the dropdown select your class and the void you just wrote.