void OnDestroy() { #if UNITY_EDITOR EditorApplication.update -= OnEditorUpdate; #endif PathFinder.CallThisWhenSceneObjectWasGone(); CSR3D = null; CSR2D = null; }