protected override void OnDestroy() { Camera.onPreCull -= OnPreCull; RenderPipelineManager.beginCameraRendering -= OnPreCull; SceneView.duringSceneGui -= SceneViewOnBeforeSceneGui; #if !UNITY_2020_1_OR_NEWER // So that if you're not using subscene conversion, we clean up after playmode foreach (var camera in _ModifiedCameras) { if (camera == null) { continue; } ulong newmask = camera.overrideSceneCullingMask; newmask &= ~(EditorSceneManager.DefaultSceneCullingMask | EditorRenderData.LiveLinkEditGameViewMask | EditorRenderData.LiveLinkEditSceneViewMask); camera.overrideSceneCullingMask = newmask; } _ModifiedCameras.Clear(); #endif if (_EditorLiveLink != null) { _EditorLiveLink.Dispose(); } _SceneChangeTracker.Dispose(); _Patcher.Dispose(); _UnloadScenes.Dispose(); _LoadScenes.Dispose(); }
protected override void OnDestroy() { Camera.onPreCull -= OnPreCull; RenderPipelineManager.beginCameraRendering -= OnPreCull; SceneView.duringSceneGui -= SceneViewOnBeforeSceneGui; if (_EditorLiveLink != null) { _EditorLiveLink.Dispose(); } _SceneChangeTracker.Dispose(); _Patcher.Dispose(); _UnloadScenes.Dispose(); _LoadScenes.Dispose(); }