public override void OnInspectorGUI() { var component = (ValueSynchronizer <T>)target; serializedObject.Update(); var entryIdProperty = serializedObject.FindProperty("_entryId"); using (var ccs = new EditorGUI.ChangeCheckScope()) { EditorGUILayout.PropertyField(entryIdProperty, new GUIContent("Entry")); if (ccs.changed) { serializedObject.ApplyModifiedProperties(); component.StopObserving(); component.StartObserving(); } } serializedObject.ApplyModifiedProperties(); if (GUILayout.Button("Open Palette Editor")) { PaletteEditorWindow.Open(); } }
public void SetupPaletteEditor(PaletteEditorWindow window) { _paletteEditorWindowController?.Dispose(); _paletteEditorWindowPresenter?.Dispose(); var controller = new PaletteEditorWindowController(_storeRepository, _guiState, window); var presenter = new PaletteEditorWindowPresenter(_storeRepository, _guiState, window); _paletteEditorWindowController = controller; _paletteEditorWindowPresenter = presenter; _paletteEditorWindow = window; }