private void OnEnable() { list = new ReorderableList(serializedObject, serializedObject.FindProperty("SettingsSets"), true, true, true, true); list.drawHeaderCallback = (Rect rect) => { EditorGUI.LabelField(rect, "Saved SpriteSettings"); }; list.onAddCallback = (ReorderableList l) => { SpriteSettingsConfig objAsConfig = (SpriteSettingsConfig)serializedObject.targetObject; objAsConfig.AddDefaultSpriteSetting(); // Predict new size since it's not serialized yet int newSize = l.serializedProperty.arraySize + 1; SelectSetting(newSize - 1); }; }
void DrawEmptySaveSettings() { EditorGUILayout.Space(); EditorGUILayout.LabelField("Create a Saved SpriteSetting to start applying SpriteSettings."); if (GUILayout.Button("Create Setting")) { if (config == null) { LoadOrCreateConfig(); } EditorWindow.GetWindow <SpriteSettingsConfigWindow>("Saved SpriteSettings", true); if (config != null && config.SettingsSets.Count == 0) { config.AddDefaultSpriteSetting(); } } EditorGUILayout.Space(); }
void DrawEmptySaveSettings() { EditorGUILayout.Space(); EditorGUILayout.LabelField("Create a Saved SpriteSetting to start applying SpriteSettings."); if (GUILayout.Button("Create Setting")) { if (config == null) { CreateConfig(); } ShowConfigWindow(0); if (config.SettingsSets.Count == 0) { config.AddDefaultSpriteSetting(); } } EditorGUILayout.Space(); }