using UnityEngine;
using System.Collections;
public class LightsONSctript : MonoBehaviour {
private Light myLight;
void Start () {
myLight = GetComponent<Light> ();
}
void Update () {
if (Input.GetKeyDown (KeyCode.L)) {
GetComponent<Renderer> ().material.color = Color.yellow;
myLight.enabled = !myLight.enabled;
Debug.Log("Action");
}
if (myLight.enabled = false) {
GetComponent<Renderer> ().material.color = Color.red;
}
}
}