public static AmbientLightSettings.State Lerp(AmbientLightSettings.State a, AmbientLightSettings.State b, float t) { AmbientLightSettings.State state = new AmbientLightSettings.State(); t = Mathf.Clamp01(t); state.AmbientLightColor = Color.Lerp(a.AmbientLightColor, b.AmbientLightColor, t); state.FogColor = Color.Lerp(a.FogColor, b.FogColor, t); state.FogStartDistance = Mathf.Lerp(a.FogStartDistance, b.FogStartDistance, t); state.FogEndDistance = Mathf.Lerp(a.FogEndDistance, b.FogEndDistance, t); return(state); }
private void LateUpdate() { AmbientLightSettings volume = AmbientLightSettings.FindVolume(((Component)this).get_transform().get_position()); if (Object.op_Inequality((Object)volume, (Object)this.mNextAmbientVolume) && Object.op_Inequality((Object)volume, (Object)this.mCurrentAmbientVolume)) { this.mNextAmbientVolume = volume; this.mAmbientStateStart = this.mCurrentAmbientState; this.mAmbientStateEnd = (AmbientLightSettings.State) this.mNextAmbientVolume; this.mAmbientStateTransition = 0.0f; } if (!Object.op_Inequality((Object)this.mCurrentAmbientVolume, (Object)this.mNextAmbientVolume)) { return; } this.mAmbientStateTransition = Mathf.Clamp01(this.mAmbientStateTransition + Time.get_deltaTime()); this.mCurrentAmbientState = AmbientLightSettings.State.Lerp(this.mAmbientStateStart, this.mAmbientStateEnd, this.mAmbientStateTransition); if ((double)this.mAmbientStateTransition < 1.0) { return; } this.mCurrentAmbientVolume = this.mNextAmbientVolume; this.mNextAmbientVolume = (AmbientLightSettings)null; }
private void Start() { this.mCurrentAmbientState = (AmbientLightSettings.State)((AmbientLightSettings)null); }