Example #1
0
    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();
        }
    }
Example #2
0
    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);
        }
    }