Browse Source

Correctly destroy resources when not in play mode

fsr3
Nico de Poel 2 years ago
parent
commit
7b37a0fba1
  1. 7
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerResources.cs

7
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerResources.cs

@ -207,7 +207,14 @@ namespace FidelityFX
if (resource == null) if (resource == null)
return; return;
#if UNITY_EDITOR
if (Application.isPlaying && !UnityEditor.EditorApplication.isPaused)
UnityEngine.Object.Destroy(resource);
else
UnityEngine.Object.DestroyImmediate(resource);
#else
UnityEngine.Object.Destroy(resource); UnityEngine.Object.Destroy(resource);
#endif
resource = null; resource = null;
} }

Loading…
Cancel
Save