Enabling and Disabling Components
EnableComponents using UnityEngine; using System.Collections; public class EnableComponents : MonoBehaviour { private Light myLight; void Start () { myLight = GetComponent<Light>(); } void Update () { if(Input.GetKeyUp(KeyCode.Space)) { myLight.enabled = !myLight.enabled; } } } What I Learned In this task I learned how to enable and disable unity components via script and or Unity Editor.