protected virtual void OnHourChange(int hour) { if (DayClass.DayLights()) { Lights(false); return; } if (!ControlBuilding) { return; } Lights(ControlBuilding.CanVisit()); }
protected override void OnHourChange(int hour) { if (DayClass.DayLights() || DayClass.CloseLights()) { CloseAll(); return; } if (!Building) { CloseAll(); return; } if (Building is Office && !Building.CanVisit() || !Building.CanWork()) { CloseAll(); } else { OpenAll(); } }
protected virtual void OnHourChange(int hour) { if (DayClass.CloseLights()) { CloseAll(); return; } if (DayClass.DayLights()) { return; } foreach (SpriteRenderer win in windows) { if (win.gameObject.activeSelf && DayClass.Hour > 0) { continue; } win.color = Random.ColorHSV(); win.gameObject.SetActive(Random.value < 0.1f); } }
// Update is called once per frame void Update() { GetComponent <Light>().enabled = !DayClass.DayLights(); }