void OnDisable() { if (actualTriggerProxy != null) { DestroyImmediate(actualTriggerProxy.gameObject); actualTriggerProxy = null; } ReleaseMaterials(); ReleaseTextures(); #if TRIAL if (watermark != null) { DestroyImmediate(watermark); watermark = null; } #endif }
void OnDisable() { if (actualTriggerProxy != null) { if (Application.isPlaying) { Destroy(actualTriggerProxy.gameObject); } actualTriggerProxy = null; } ReleaseMaterials(); ReleaseTextures(); #if TRIAL if (watermark != null) { // DestroyImmediate( watermark ); watermark = null; } #endif }
void Update() { if (silentError) { return; } CheckCamera(); bool volumesBlendFinished = false; if (volumesBlending) { volumesBlendAmount = (volumesBlendingTime - volumesBlendingTimeCountdown) / volumesBlendingTime; volumesBlendingTimeCountdown -= Time.smoothDeltaTime; if (volumesBlendAmount >= 1.0f) { volumesBlendAmount = 1; volumesBlendFinished = true; } } 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 }; if (TriggerVolumeProxy != null && TriggerVolumeProxy.GetComponent <Collider2D>() != null) { actualTriggerProxy = obj.AddComponent <AmplifyColorTriggerProxy2D>(); } else { actualTriggerProxy = obj.AddComponent <AmplifyColorTriggerProxy>(); } actualTriggerProxy.OwnerEffect = this; } UpdateVolumes(); } else if (actualTriggerProxy != null) { DestroyImmediate(actualTriggerProxy.gameObject); actualTriggerProxy = null; } if (volumesBlendFinished) { LutTexture = volumesLutBlendTexture; volumesBlendAmount = 0.0f; volumesBlending = false; volumesLutBlendTexture = null; effectVolumesBlendAdjust = 0.0f; currentVolumeEffects = blendVolumeEffects; currentVolumeEffects.SetValues(this); currentExposure = blendExposure; if (blendingFromMidBlend && midBlendLUT != null) { midBlendLUT.DiscardContents(); } blendingFromMidBlend = false; } }