protected virtual void OnEnable() { Undo.undoRedoPerformed += RepaintEditorWindow; QuestEditorWindow.currentEditor = this; questSerializedObject = null; inspectorGUI = new QuestInspectorGUI(); var notPlaying = !Application.isPlaying; var questListProperty = serializedObject.FindProperty("m_questList"); if (questListProperty == null) { return; } questReorderableList = new ReorderableList(serializedObject, questListProperty, notPlaying, true, notPlaying, notPlaying); questReorderableList.drawHeaderCallback = OnDrawHeader; questReorderableList.onSelectCallback = OnChangeSelection; questReorderableList.onAddCallback = OnAddElement; questReorderableList.onRemoveCallback = OnRemoveElement; if (notPlaying) { questReorderableList.drawElementCallback = OnDrawEditableElement; questReorderableList.onReorderCallback = OnReorder; } else { questReorderableList.drawElementCallback = OnDrawRuntimeElement; } }
private void OnEnable() { EditorApplication.projectWindowItemOnGUI += OnProjectWindowItemOnGUI; Undo.undoRedoPerformed += RepaintEditorWindow; QuestEditorWindow.currentEditor = this; if (inspectorGUI == null) { inspectorGUI = new QuestInspectorGUI(); } }