public void OnEnable() { m_ShowColliderTypeFoldout = new SavedBool("PhysicsDebugWindow.ShowColliderType", false); m_CurrentTab = new SavedInt("PhysicsDebugWindow.CurrentTab", 0); m_Collumns = new SavedInt("PhysicsDebugWindow.Collumns", 1); SceneView.duringSceneGui += OnSceneGUI; Selection.selectionChanged += UpdateSelection; EditorSceneManager.sceneClosed += OnSceneClose; EditorSceneManager.sceneOpened += OnSceneOpen; EditorApplication.playModeStateChanged += PlayModeStateChanged; PhysicsDebugDraw.OnDrawPooledContacts += DrawContacts_Internal; PhysicsDebugDraw.OnRetrievePooledQueries += OnQueriesRetrieved; PhysicsDebugDraw.BeforeSimulate += BeforeSimulate; SetPickingEnabled(PhysicsVisualizationSettings.showCollisionGeometry && PhysicsVisualizationSettings.enableMouseSelect); LoadDictionary(); ClearInvalidObjects(); UpdateSelection(); PhysicsDebugDraw.ClearAllPools(); wantsLessLayoutEvents = true; }
public void OnDisable() { SceneView.duringSceneGui -= OnSceneGUI; Selection.selectionChanged -= UpdateSelection; EditorSceneManager.sceneClosed -= OnSceneClose; EditorSceneManager.sceneOpened -= OnSceneOpen; EditorApplication.playModeStateChanged -= PlayModeStateChanged; PhysicsDebugDraw.OnDrawPooledContacts -= DrawContacts_Internal; PhysicsDebugDraw.OnRetrievePooledQueries -= OnQueriesRetrieved; PhysicsDebugDraw.BeforeSimulate -= BeforeSimulate; SetPickingEnabled(false); SaveDictionary(); ClearInvalidObjects(); PhysicsDebugDraw.ClearAllPools(); }
private void ClearAllPoolsAndStoredQueries() { PhysicsDebugDraw.ClearAllPools(); ClearQueryShapes(); }