void Awake() { if (myDesk == null && Random.Range(1, 100) > 80) { myDesk = this; deskSprite.GetComponent <Renderer>().material.SetColor("_EmisColor", targetDeskColor); } }
// Use this for initialization void Start() { if (myDesk == null) { myDesk = this; } flickered = false; nextFlick = Time.time + Random.Range(flickeringMin, flickeringMax); switched = false; SetDeskStatus(false); }