Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        cameraComponent = GetComponent <Camera>();

        currentSkyColor = sunnySkyColor;

        weather.OnGotCloudy += (delayInSeconds) => {
            StartCoroutine(currentSkyColor.TransitionTo(cloudySkyColor, delayInSeconds));
        };

        weather.OnGotSunny += (delayInSeconds) => {
            StartCoroutine(currentSkyColor.TransitionTo(sunnySkyColor, delayInSeconds));
        };
    }
    // Start is called before the first frame update
    void Start()
    {
        lightComponent = GetComponent <Light>();

        currentLightColor = sunnyLightColor;

        weather.OnGotCloudy += (delayInSeconds) => {
            StartCoroutine(currentLightColor.TransitionTo(cloudyLightColor, delayInSeconds));
        };

        weather.OnGotSunny += (delayInSeconds) => {
            StartCoroutine(currentLightColor.TransitionTo(sunnyLightColor, delayInSeconds));
        };
    }