Example #1
0
    protected virtual void OnHourChange(int hour)
    {
        if (DayClass.DayLights())
        {
            Lights(false);
            return;
        }

        if (!ControlBuilding)
        {
            return;
        }
        Lights(ControlBuilding.CanVisit());
    }
Example #2
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 #3
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);
        }
    }
Example #4
0
 // Update is called once per frame
 void Update()
 {
     GetComponent <Light>().enabled = !DayClass.DayLights();
 }