diff --git a/scatterer/Effects/Proland/Atmosphere/Utils/ScaledScatteringContainer.cs b/scatterer/Effects/Proland/Atmosphere/Utils/ScaledScatteringContainer.cs index 7eef7a06..fd7e086b 100644 --- a/scatterer/Effects/Proland/Atmosphere/Utils/ScaledScatteringContainer.cs +++ b/scatterer/Effects/Proland/Atmosphere/Utils/ScaledScatteringContainer.cs @@ -81,13 +81,13 @@ public void SwitchScaledMode() public void Cleanup() { - if (!ReferenceEquals (scaledScatteringMR, null)) + if (scaledScatteringMR != null) { scaledScatteringMR.enabled = false; UnityEngine.Component.Destroy (scaledScatteringMR); } - if (!ReferenceEquals (scaledScatteringGO, null)) + if (scaledScatteringGO != null) UnityEngine.Object.Destroy(scaledScatteringGO); } } diff --git a/scatterer/Effects/Proland/Atmosphere/Utils/SkySphereContainer.cs b/scatterer/Effects/Proland/Atmosphere/Utils/SkySphereContainer.cs index 7501a2e6..91b5544e 100644 --- a/scatterer/Effects/Proland/Atmosphere/Utils/SkySphereContainer.cs +++ b/scatterer/Effects/Proland/Atmosphere/Utils/SkySphereContainer.cs @@ -104,13 +104,13 @@ public void Resize(float size) public void Cleanup() { - if (!ReferenceEquals (skySphereMR, null)) + if (skySphereMR != null) { skySphereMR.enabled = false; UnityEngine.Component.DestroyImmediate (skySphereMR); } - if (!ReferenceEquals (skySphereGO, null)) + if (skySphereGO != null) { UnityEngine.Object.DestroyImmediate(skySphereGO); } diff --git a/scatterer/Utilities/Camera/ScreenCopyCommandBuffer.cs b/scatterer/Utilities/Camera/ScreenCopyCommandBuffer.cs index e58b461c..e063e582 100644 --- a/scatterer/Utilities/Camera/ScreenCopyCommandBuffer.cs +++ b/scatterer/Utilities/Camera/ScreenCopyCommandBuffer.cs @@ -120,9 +120,9 @@ void OnPostRender() public void OnDestroy () { - if (!ReferenceEquals(targetCamera,null)) + if (targetCamera != null) { - if (!ReferenceEquals(screenCopyCommandBuffer,null)) + if (screenCopyCommandBuffer != null) { targetCamera.RemoveCommandBuffer (CameraEvent.AfterImageEffectsOpaque, screenCopyCommandBuffer); colorCopyRenderTexture.Release();