Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (!Menu.running)
        {
            return;
        }

        timer += rate * Time.deltaTime;

        //Regular updates
        lunaSol.update(pm);

        if (timer > 2.5f)
        {
            hours++;
            timer = 0f;

            pm.cycle(sm.getSeason(), wm.getWeather(), lunaSol.isDaytime());
            wm.spawnCloud();

            if (timer == 24)
            {
                hours = 0;
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            menu.toggleMenu();
        }

        pm.checkDeath();

        display.text = sm.getSeason() + ", " + wm.getWeather();
    }