Sun.Update C# (CSharp) Method

Update() private method

private Update ( ) : void
return void
    void Update()
    {
        if (DayCycle.hours >= 18 && DayCycle.hours < 20) {
            sun.intensity -= (sun.intensity > nightBrightness) ? (sunRate) : (0);
        } else if (DayCycle.hours >= 6 && DayCycle.hours < 8) {
            sun.intensity += (sun.intensity < dayBrightness) ? (sunRate) : (0);
        } else if (DayCycle.hours >= 8 && DayCycle.hours < 18) {
            sun.intensity = dayBrightness;
        } else if (DayCycle.hours >= 20 || DayCycle.hours < 6) {
            sun.intensity = nightBrightness;
        }
    }

Usage Example

示例#1
0
        public void Update(GameTime gameTime)
        {
            Time.Update(gameTime);

            ambientalLightShader.Update(Time.Value);

            sky.Update(Time);
            stars.Update(Time);
            moon.Update(Time);
            sun.Update(Time);

            clouds.Update(Lights);
        }
All Usage Examples Of Sun::Update