// --------------------------------------------------------------------------- // Perform Cleanup when MAST Window is Disabled // --------------------------------------------------------------------------- private void OnDisable() { //Debug.Log("Interface - On Disable"); // Save MAST Settings to Scriptable Objects MAST_Settings.Save_Settings(); // If OnDisable triggered by going fullscreen, closing MAST, or changing scenes if (!inPlayMode) { MAST_Interface_Data_Manager.Save_Interface_State(); } // If OnDisable is triggered by the user hitting play button else { // If cleanup hasn't already ocurred if (!isCleanedUp) { // Load interface and palette data state MAST_Interface_Data_Manager.Save_Interface_State(); MAST_Interface_Data_Manager.Save_Palette_Items(); CleanUpInterface(); isCleanedUp = true; } } }
// --------------------------------------------------------------------------- // Perform Cleanup when MAST Window is Disabled // --------------------------------------------------------------------------- private void OnDisable() { //Debug.Log("Interface - On Disable"); // Save MAST Settings to Scriptable Objects MAST_Settings.Save_Settings(); // If OnDisable triggered by going fullscreen, closing MAST, or changing scenes if (!inPlayMode) { MAST_Interface_Data_Manager.Save_Interface_State(); } // If OnDisable is triggered by the user hitting play button else { // If cleanup hasn't already ocurred if (!isCleanedUp) { // Load interface and palette data state MAST_Interface_Data_Manager.Save_Interface_State(); MAST_Interface_Data_Manager.Save_Palette_Items(); CleanUpInterface(); isCleanedUp = true; } } // Remove SceneView delegate #if UNITY_2019_1_OR_NEWER SceneView.duringSceneGui -= this.OnScene; #else SceneView.onSceneGUIDelegate -= this.OnScene; #endif }