コード例 #1
0
    private void LightDirection()
    {
        DateTime theTime = clockSystem.GetCurrentDateTime();
        float    seconds = (theTime.Hour * 3600) + (theTime.Minute * 60) + theTime.Second;

        // Change sun position
        DirectionalLight.transform.localRotation = Quaternion.Euler((seconds * 0.0041667f) - 90, -60, 0);

        // Blend skybox material
        float blendTime = (-(seconds * seconds) / 1866240000) + (seconds / 21600);

        skyboxMaterial.SetFloat("_BlendCubemaps", blendTime);

        // Rotate skybox
        skyboxMaterial.SetFloat("_Rotation", (seconds / 90060) * 360);

        // Blend fog color
        RenderSettings.fogColor = Color.Lerp(fogNightColor, fogDayColor, blendTime);
    }
コード例 #2
0
 private void GameClock()
 {
     GameConfiguration.gameTime = clockSystem.GetCurrentDateTime();
 }