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(); } }
void Update() { float intensity = receiver.GetLightIntensity(); light.SetLightIntensity(intensity); this.areaLight.intensity = intensity; }
void Update() { float sunIntensity = receiver.GetLightIntensity(); EventManager.main.ChargeEnergy(((sunIntensity)) * Time.deltaTime); }