Skip to content

Commit 2e2611b

Browse files
committed
Ignore m_SerializedDataModeController in Toolbox wizards; minor refactor changes
1 parent 77a5642 commit 2e2611b

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

Assets/Editor Toolbox/Editor/Wizards/ScriptableObjectCreationWizard.cs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -88,37 +88,36 @@ internal static void Initialize()
8888

8989
private void DrawSettingsPanel()
9090
{
91-
EditorGUILayout.LabelField("Settings", EditorStyles.boldLabel);
92-
9391
var rect = EditorGUILayout.GetControlRect(true);
92+
rect = EditorGUI.PrefixLabel(rect, Style.typeContent);
9493
typeField.OnGui(rect, true, OnTypeSelected, data.InstanceType);
9594
if (data.InstanceType == null)
9695
{
9796
return;
9897
}
9998

100-
ToolboxEditorGui.DrawLine();
101-
10299
EditorGUI.BeginChangeCheck();
103100
data.InstanceName = EditorGUILayout.TextField(Style.nameContent, data.InstanceName);
104101
data.InstancesCount = EditorGUILayout.IntField(Style.countContent, data.InstancesCount);
105-
106-
EditorGUI.BeginChangeCheck();
107-
var assignedInstance = EditorGUILayout.ObjectField(Style.objectContent, data.BlueprintObject, data.InstanceType, false);
108-
data.BlueprintObject = assignedInstance;
109-
if (EditorGUI.EndChangeCheck())
102+
using (new EditorGUILayout.HorizontalScope())
110103
{
111-
UpdateBlueprintObjectEditor();
112-
}
104+
EditorGUI.BeginChangeCheck();
105+
var assignedInstance = EditorGUILayout.ObjectField(Style.objectContent, data.BlueprintObject, data.InstanceType, false);
106+
data.BlueprintObject = assignedInstance;
107+
if (EditorGUI.EndChangeCheck())
108+
{
109+
UpdateBlueprintObjectEditor();
110+
}
113111

114-
if (assignedInstance != null)
115-
{
116-
inspectDefaultObject = GUILayout.Toggle(inspectDefaultObject,
117-
Style.foldoutContent, Style.foldoutStyle, Style.foldoutOptions);
118-
}
119-
else
120-
{
121-
inspectDefaultObject = false;
112+
if (assignedInstance != null)
113+
{
114+
inspectDefaultObject = GUILayout.Toggle(inspectDefaultObject,
115+
Style.foldoutContent, Style.foldoutStyle, Style.foldoutOptions);
116+
}
117+
else
118+
{
119+
inspectDefaultObject = false;
120+
}
122121
}
123122

124123
if (inspectDefaultObject)
@@ -129,7 +128,6 @@ private void DrawSettingsPanel()
129128
}
130129
}
131130

132-
133131
if (EditorGUI.EndChangeCheck())
134132
{
135133
OnWizardUpdate();
@@ -237,7 +235,7 @@ protected override void OnWizardUpdate()
237235
protected override void OnWizardGui()
238236
{
239237
base.OnWizardGui();
240-
using (new EditorGUILayout.VerticalScope(Style.backgroundStyle))
238+
using (new EditorGUILayout.VerticalScope())
241239
{
242240
DrawSettingsPanel();
243241
}
@@ -250,6 +248,7 @@ private static class Style
250248
internal static readonly GUIStyle backgroundStyle;
251249
internal static readonly GUIStyle foldoutStyle;
252250

251+
internal static readonly GUIContent typeContent = new GUIContent("Instance Type");
253252
internal static readonly GUIContent nameContent = new GUIContent("Instance Name");
254253
internal static readonly GUIContent countContent = new GUIContent("Instances Count", "Indicates how many instances will be created.");
255254
internal static readonly GUIContent objectContent = new GUIContent("Blueprint Object", "Will be used as a blueprint for all created ScriptableObjects.");

Assets/Editor Toolbox/Editor/Wizards/ToolboxWizard.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ namespace Toolbox.Editor.Wizards
77

88
public class ToolboxWizard : EditorWindow
99
{
10+
private static readonly string[] propertiesToIgnore = new string[]
11+
{
12+
PropertyUtility.Defaults.scriptPropertyName,
13+
"m_SerializedDataModeController"
14+
};
15+
1016
private Editor targetEditor;
1117

1218
private Vector2 scrollPosition;
@@ -84,7 +90,10 @@ private void ReinitEditor(Editor editor)
8490
editor.hideFlags = HideFlags.HideAndDontSave;
8591
if (editor is ToolboxEditor toolboxEditor)
8692
{
87-
toolboxEditor.IgnoreProperty(PropertyUtility.Defaults.scriptPropertyName);
93+
foreach (var property in propertiesToIgnore)
94+
{
95+
toolboxEditor.IgnoreProperty(property);
96+
}
8897
}
8998
}
9099

Assets/Editor Toolbox/Runtime/Attributes/Toolbox/ArchetypeAttributes/TitleAttribute.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public TitleAttribute(string label)
1919
Label = label;
2020
}
2121

22-
2322
public override ToolboxAttribute[] Process()
2423
{
2524
return new ToolboxAttribute[]
@@ -42,7 +41,6 @@ public override ToolboxAttribute[] Process()
4241
};
4342
}
4443

45-
4644
public string Label { get; private set; }
4745

4846
/// <summary>

Docs/createso.png

6.53 KB
Loading

0 commit comments

Comments
 (0)