How to ACTIVATE and DEACTIVATE COMPONENTS through script in Unity

Publicado el: 21 noviembre 2020
en el canal de: GDT Solutions ES
8,773
106

GameObjects can have different Scripts assigned to them that give them a certain behavior.
In this video we are going to see how to activate and deactivate the scripts that are attached to those GameObjects in Unity through a script. For example we are going to see how to turn on and off an AudioSource component, how to turn on and off a Light component or how to enable and disable a Script that we ourselves have created, all this using code.
To do this we will create a script that has a reference to the type of object we want to activate or deactivate and then we will manually assign the variable "enabled" that indicates the state of enablement of that component, if this variable is assigned the value "false", the component will be inactive, if we assign the value "true" the component will be active.

____________________________________________________________
LINKS

Portfolio: https://gamedevtraum.com/en/portfolio...

LinkedIn:   / gamedevtraum  

Downloads: https://gamedevtraum.itch.io/

Contact:   / gamedevtraum  
____________________________________________________________

#EN


En esta página del sitio puede ver el video en línea How to ACTIVATE and DEACTIVATE COMPONENTS through script in Unity de Duración hora minuto segunda en buena calidad , que subió el usuario GDT Solutions ES 21 noviembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 8,773 veces y le gustó 106 a los espectadores. Disfruta viendo!