public override void OnInspectorGUI() { DrawDefaultInspector(); serializedObject.Update(); EditorGUILayout.PropertyField(viewMode_Prop); Gallery.ViewMode vm = (Gallery.ViewMode)viewMode_Prop.enumValueIndex; switch (vm) { case Gallery.ViewMode.grid: //show columns EditorGUILayout.PropertyField(columns_Prop, new GUIContent("Columns")); break; case Gallery.ViewMode.horizontal: //dont show columns break; case Gallery.ViewMode.vertical: //dont show columns break; } Gallery gallery = (Gallery)target; if (GUILayout.Button("Refresh")) { try{ gallery.ApplyChanges(); } catch (Exception e) { Debug.Log("Changes are only previewed in game mode."); } } // if(GUILayout.Button ("Load")) // { // gallery.CreateNew(); // } serializedObject.ApplyModifiedProperties(); }