Unity Open Panel on Button Click

preview_player
Показать описание
I will show you, how you can open and close a panel with the same button, in Unity.

Equipment:
PC Screens
Microphone
Mouse
Keyboard
Webcam

#UnityTutorial #UnityTutorialForBeginners #gameDev #Unity#Investment #Software #USA
Рекомендации по теме
Комментарии
Автор

what if i have buttons on the menu will they be able to press it without it being there?

boogaplays
Автор

The problem with this method is that you would need to apply this to all children of the object as well. What you can do instead is take a game object and call its .SetActive method. You can even get it down to a single line with no if statements as well



Doing it this way will deactivate the object and no longer render any children either and works by looking if it's active and setting it to the opposite value. Another added bonus is that it works for any object that inherits from MonoBehaviour instead of it needing a CanvasGroup component

ThePhantomVulpes
visit shbcf.ru