Link UI Toggle to a Boolean Variable in C# Unity

Publicado em: 15 Janeiro 2023
no canal de: DA LAB
2,700
24

We can simply hide and show a game object using Unity UI toggle as shown in the link below.
   • Show and Hide Object with UI Toggle i...  

However, sometimes, we need to pass the toggle value as a boolean variable in C#, or to change a text, for example, based on the toggle value.
The Toggle has a single event called On Value Changed, which passes a boolean parameter to the event function in C#.
Make sure to choose Dynamic bool when selecting a method On Value Changed (Boolean).

Code on GitHub:
https://github.com/DA-LAB-Tutorials/Y...


Nesta página do site você pode assistir ao vídeo on-line Link UI Toggle to a Boolean Variable in C# Unity duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário DA LAB 15 Janeiro 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 2,700 vezes e gostou 24 espectadores. Boa visualização!