void SceneUpdate(SceneView SceneView) { if (EditorApplication.isCompiling) { DestroyImmediate(this); return; } Handles.BeginGUI(); this.BuildLayout(); if (GUI.Button(this.resButton, "资源")) { this.showResWindow = !this.showResWindow; } if (GUI.Button(this.closeButton, "关闭")) { ResWindow.Clear(); //EntityWindow.Clear(); DestroyImmediate(this); } if (this.showResWindow) { GUI.Window(GUIUtility.GetControlID(FocusType.Passive), this.resWindow, new GUI.WindowFunction(ResWindow.OnGUI), "资源"); } Handles.EndGUI(); this.InputReaction(); }
private void OnDestroy() { //SceneResData.SaveCache(); ResWindow.Clear(); //EntityWindow.Clear(); //DungeonCache.Destroy(); SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.Remove(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(this.SceneUpdate)); this.sceneView.maximized = false; }