@@ -65,6 +65,7 @@ public void Validate()
6565 private static readonly TypeField typeField = new TypeField ( sharedConstraint , sharedAppearance ) ;
6666
6767 private readonly CreationData data = new CreationData ( ) ;
68+ private bool editDefaultObject ;
6869
6970 [ MenuItem ( "Assets/Create/Toolbox/ScriptableObject Creation Wizard" , priority = 9 ) ]
7071 internal static void Initialize ( )
@@ -88,7 +89,25 @@ private void DrawSettingsPanel()
8889 data . InstanceName = EditorGUILayout . TextField ( "Instance Name" , data . InstanceName ) ;
8990 data . InstancesCount = EditorGUILayout . IntField ( "Instances To Create" , data . InstancesCount ) ;
9091 var content = new GUIContent ( "Default Object" , "Will be used as a blueprint for all created ScriptableObjects." ) ;
91- data . DefaultObject = EditorGUILayout . ObjectField ( content , data . DefaultObject , data . InstanceType , false ) ;
92+ var instance = EditorGUILayout . ObjectField ( content , data . DefaultObject , data . InstanceType , false ) ;
93+ if ( instance != null )
94+ {
95+ editDefaultObject = GUILayout . Toggle ( editDefaultObject ,
96+ Style . foldoutContent , Style . foldoutStyle , Style . foldoutOptions ) ;
97+ }
98+ else
99+ {
100+ editDefaultObject = false ;
101+ }
102+
103+ if ( editDefaultObject )
104+ {
105+ EditorGUI . indentLevel ++ ;
106+ ToolboxEditorGui . DrawObjectProperties ( instance ) ;
107+ EditorGUI . indentLevel -- ;
108+ }
109+
110+ data . DefaultObject = instance ;
92111 if ( EditorGUI . EndChangeCheck ( ) )
93112 {
94113 OnWizardUpdate ( ) ;
@@ -177,12 +196,42 @@ protected override void OnWizardUpdate()
177196 protected override void OnWizardGui ( )
178197 {
179198 base . OnWizardGui ( ) ;
180- using ( new EditorGUILayout . VerticalScope ( EditorStyles . helpBox ) )
199+ using ( new EditorGUILayout . VerticalScope ( Style . backgroundStyle ) )
181200 {
182201 DrawSettingsPanel ( ) ;
183202 }
184203 }
185204
186205 protected override bool CloseOnCreate => false ;
206+
207+ private static class Style
208+ {
209+ internal static readonly GUIStyle backgroundStyle ;
210+ internal static readonly GUIStyle foldoutStyle ;
211+
212+ internal static readonly GUIContent foldoutContent = new GUIContent ( "Inspect" , "Show/Hide Properties" ) ;
213+
214+ internal static readonly GUILayoutOption [ ] foldoutOptions = new GUILayoutOption [ ]
215+ {
216+ GUILayout . Width ( 60.0f )
217+ } ;
218+
219+ static Style ( )
220+ {
221+ backgroundStyle = new GUIStyle ( EditorStyles . helpBox )
222+ {
223+ padding = new RectOffset ( 13 , 13 , 8 , 8 )
224+ } ;
225+ foldoutStyle = new GUIStyle ( EditorStyles . miniButton )
226+ {
227+ #if UNITY_2019_3_OR_NEWER
228+ fontSize = 10 ,
229+ #else
230+ fontSize = 9 ,
231+ #endif
232+ alignment = TextAnchor. MiddleCenter
233+ } ;
234+ }
235+ }
187236 }
188237}
0 commit comments