예제 #1
0
    void Update()
    {
        growth += Time.deltaTime;
        float sunIntensity = receiver.GetLightIntensity();

        sunlight += ((sunIntensity * sunLightMultiplier) - (sunLightDecay)) * Time.deltaTime;
        sunlight  = Mathf.Clamp(sunlight, 0, 10);
        water    += ((EventManager.main.waterPressure * waterMultiplier) - (waterDecay)) * Time.deltaTime;
        water     = Mathf.Clamp(water, 0, 10);

        if (sunlight == 0)
        {
            health -= (healthDecay * Time.deltaTime);
        }
        if (water == 0)
        {
            health -= (healthDecay * Time.deltaTime);
        }

        if (health <= 0)
        {
            EventManager.main.LoseGame();
        }
        if (growth >= 900)
        {
            EventManager.main.WinGame();
        }
    }
예제 #2
0
    void Update()
    {
        float intensity = receiver.GetLightIntensity();

        light.SetLightIntensity(intensity);
        this.areaLight.intensity = intensity;
    }
예제 #3
0
    void Update()
    {
        float sunIntensity = receiver.GetLightIntensity();

        EventManager.main.ChargeEnergy(((sunIntensity)) * Time.deltaTime);
    }