void Update() { if ( volumesBlending ) { volumesBlendAmount = ( volumesBlendingTime - volumesBlendingTimeCountdown ) / volumesBlendingTime; volumesBlendingTimeCountdown -= Time.smoothDeltaTime; if ( volumesBlendAmount >= 1.0f ) { LutTexture = volumesLutBlendTexture; volumesBlendAmount = 0.0f; volumesBlending = false; volumesLutBlendTexture = null; effectVolumesBlendAdjust = 0.0f; currentVolumeEffects = blendVolumeEffects; currentVolumeEffects.SetValues( this ); if ( blendingFromMidBlend && midBlendLUT != null ) midBlendLUT.DiscardContents(); blendingFromMidBlend = false; } } else volumesBlendAmount = Mathf.Clamp01( volumesBlendAmount ); if ( blending ) { BlendAmount = ( blendingTime - blendingTimeCountdown ) / blendingTime; blendingTimeCountdown -= Time.smoothDeltaTime; if ( BlendAmount >= 1.0f ) { LutTexture = LutBlendTexture; BlendAmount = 0.0f; blending = false; LutBlendTexture = null; if ( onFinishBlend != null ) onFinishBlend(); } } else BlendAmount = Mathf.Clamp01( BlendAmount ); if ( UseVolumes ) { if ( actualTriggerProxy == null ) { GameObject obj = new GameObject( name + "+ACVolumeProxy" ) { hideFlags = HideFlags.HideAndDontSave }; actualTriggerProxy = obj.AddComponent<AmplifyColorTriggerProxy>(); actualTriggerProxy.OwnerEffect = this; } UpdateVolumes(); } else if ( actualTriggerProxy != null ) { DestroyImmediate( actualTriggerProxy.gameObject ); actualTriggerProxy = null; } }
private void Update() { if (this.volumesBlending) { this.volumesBlendAmount = (this.volumesBlendingTime - this.volumesBlendingTimeCountdown) / this.volumesBlendingTime; this.volumesBlendingTimeCountdown -= Time.smoothDeltaTime; if (this.volumesBlendAmount >= 1f) { this.LutTexture = this.volumesLutBlendTexture; this.volumesBlendAmount = 0f; this.volumesBlending = false; this.volumesLutBlendTexture = null; this.effectVolumesBlendAdjust = 0f; this.currentVolumeEffects = this.blendVolumeEffects; this.currentVolumeEffects.SetValues(this); if (this.blendingFromMidBlend && this.midBlendLUT != null) { this.midBlendLUT.DiscardContents(); } this.blendingFromMidBlend = false; } } else { this.volumesBlendAmount = Mathf.Clamp01(this.volumesBlendAmount); } if (this.blending) { this.BlendAmount = (this.blendingTime - this.blendingTimeCountdown) / this.blendingTime; this.blendingTimeCountdown -= Time.smoothDeltaTime; if (this.BlendAmount >= 1f) { this.LutTexture = this.LutBlendTexture; this.BlendAmount = 0f; this.blending = false; this.LutBlendTexture = null; if (this.onFinishBlend != null) { this.onFinishBlend(); } } } else { this.BlendAmount = Mathf.Clamp01(this.BlendAmount); } if (this.UseVolumes) { if (this.actualTriggerProxy == null) { GameObject gameObject = new GameObject(base.name + "+ACVolumeProxy") { hideFlags = HideFlags.HideAndDontSave }; this.actualTriggerProxy = gameObject.AddComponent<AmplifyColorTriggerProxy>(); this.actualTriggerProxy.OwnerEffect = this; } this.UpdateVolumes(); } else if (this.actualTriggerProxy != null) { UnityEngine.Object.DestroyImmediate(this.actualTriggerProxy.gameObject); this.actualTriggerProxy = null; } }
void OnDisable() { if ( actualTriggerProxy != null ) { DestroyImmediate( actualTriggerProxy.gameObject ); actualTriggerProxy = null; } ReleaseMaterials(); ReleaseTextures(); #if TRIAL if ( watermark != null ) { DestroyImmediate( watermark ); watermark = null; } #endif }
private void OnDisable() { if (this.actualTriggerProxy != null) { UnityEngine.Object.DestroyImmediate(this.actualTriggerProxy.gameObject); this.actualTriggerProxy = null; } this.ReleaseMaterials(); this.ReleaseTextures(); }