private static void ShowWindow() { GoapAIScenarioWindow window = ( GoapAIScenarioWindow )EditorWindow.GetWindow(typeof(GoapAIScenarioWindow), false, "Goap AI编辑器"); window.autoRepaintOnSceneChange = true; }
void OnDisable() { current = null; EditorPrefs.SetBool("GoapAIScenarioWindow.isEditorLocked", isEditorLocked); EditorPrefs.SetFloat("GoapAIScenarioWindow.zoomFactor", zoomFactor); EditorApplication.playModeStateChanged -= PlayModeChange; Selection.selectionChanged -= OnSelectionChange; }
void OnEnable() { current = this; titleContent = new GUIContent("Goap", EditorGUIUtility.FindTexture("tree_icon_leaf")); willRepaint = true; fullDrawPass = true; wantsMouseMove = true; minSize = new Vector2(700, 300); isEditorLocked = EditorPrefs.GetBool("GoapAIScenarioWindow.isEditorLocked", isEditorLocked); zoomFactor = EditorPrefs.GetFloat("GoapAIScenarioWindow.zoomFactor", zoomFactor); EditorApplication.playModeStateChanged -= PlayModeChange; EditorApplication.playModeStateChanged += PlayModeChange; Selection.selectionChanged -= OnSelectionChange; Selection.selectionChanged += OnSelectionChange; }