@@ -296,78 +296,77 @@ private void DrawSettings(ScriptableObjectCollection collection)
296296 {
297297 using ( new GUILayout . VerticalScope ( "Box" ) )
298298 {
299- showSettings = EditorGUILayout . BeginFoldoutHeaderGroup ( showSettings , "Settings" , EditorStyles . foldoutHeader ) ;
299+ EditorGUI . indentLevel ++ ;
300+ showSettings = EditorGUILayout . Foldout ( showSettings , "Settings" , true ) ;
301+ EditorGUI . indentLevel -- ;
302+
303+ if ( showSettings )
300304 {
301- if ( showSettings )
305+ EditorGUI . indentLevel ++ ;
306+
307+ using ( EditorGUI . ChangeCheckScope changeCheck = new EditorGUI . ChangeCheckScope ( ) )
302308 {
303- EditorGUI . indentLevel ++ ;
309+ bool isAutomaticallyLoaded = EditorGUILayout . ToggleLeft ( "Automatically Loaded" ,
310+ ScriptableObjectCollectionSettings . Instance . IsCollectionAutomaticallyLoaded (
311+ collection ) ) ;
304312
305- using ( EditorGUI . ChangeCheckScope changeCheck = new EditorGUI . ChangeCheckScope ( ) )
313+ if ( changeCheck . changed )
306314 {
307- bool isAutomaticallyLoaded = EditorGUILayout . ToggleLeft ( "Automatically Loaded" ,
308- ScriptableObjectCollectionSettings . Instance . IsCollectionAutomaticallyLoaded (
315+ ScriptableObjectCollectionSettings . Instance . SetCollectionAutomaticallyLoaded (
316+ collection ,
317+ isAutomaticallyLoaded ) ;
318+ }
319+ }
320+
321+ using ( EditorGUI . ChangeCheckScope changeCheck = new EditorGUI . ChangeCheckScope ( ) )
322+ {
323+ GeneratedStaticFileType staticCodeGeneratorType =
324+ ( GeneratedStaticFileType ) EditorGUILayout . EnumPopup ( "Static File Generator Type" ,
325+ ScriptableObjectCollectionSettings . Instance . GetStaticFileTypeForCollection (
309326 collection ) ) ;
310327
311- if ( changeCheck . changed )
312- {
313- ScriptableObjectCollectionSettings . Instance . SetCollectionAutomaticallyLoaded (
314- collection ,
315- isAutomaticallyLoaded ) ;
316- }
328+ if ( changeCheck . changed )
329+ {
330+ ScriptableObjectCollectionSettings . Instance . SetStaticFileGeneratorTypeForCollection (
331+ collection ,
332+ staticCodeGeneratorType ) ;
317333 }
334+ }
318335
319- using ( EditorGUI . ChangeCheckScope changeCheck = new EditorGUI . ChangeCheckScope ( ) )
336+ bool overwriteStaticFileLocation = false ;
337+ using ( EditorGUI . ChangeCheckScope changeCheck = new EditorGUI . ChangeCheckScope ( ) )
338+ {
339+ overwriteStaticFileLocation = EditorGUILayout . ToggleLeft (
340+ "Overwrite Static File Location" ,
341+ ScriptableObjectCollectionSettings . Instance . IsOverridingStaticFileLocation ( collection ) ) ;
342+ if ( changeCheck . changed )
320343 {
321- GeneratedStaticFileType staticCodeGeneratorType =
322- ( GeneratedStaticFileType ) EditorGUILayout . EnumPopup ( "Static File Generator Type" ,
323- ScriptableObjectCollectionSettings . Instance . GetStaticFileTypeForCollection (
324- collection ) ) ;
325-
326- if ( changeCheck . changed )
327- {
328- ScriptableObjectCollectionSettings . Instance . SetStaticFileGeneratorTypeForCollection (
329- collection ,
330- staticCodeGeneratorType ) ;
331- }
344+ ScriptableObjectCollectionSettings . Instance . SetOverridingStaticFileLocation (
345+ collection , overwriteStaticFileLocation ) ;
332346 }
347+ }
333348
334- bool overwriteStaticFileLocation = false ;
349+ if ( overwriteStaticFileLocation )
350+ {
351+ DefaultAsset targetFolder = AssetDatabase . LoadAssetAtPath < DefaultAsset > (
352+ ScriptableObjectCollectionSettings . Instance . GetStaticFileFolderForCollection (
353+ collection ) ) ;
335354 using ( EditorGUI . ChangeCheckScope changeCheck = new EditorGUI . ChangeCheckScope ( ) )
336355 {
337- overwriteStaticFileLocation = EditorGUILayout . ToggleLeft (
338- "Overwrite Static File Location" ,
339- ScriptableObjectCollectionSettings . Instance . IsOverridingStaticFileLocation ( collection ) ) ;
340- if ( changeCheck . changed )
341- {
342- ScriptableObjectCollectionSettings . Instance . SetOverridingStaticFileLocation (
343- collection , overwriteStaticFileLocation ) ;
344- }
345- }
356+ targetFolder = ( DefaultAsset ) EditorGUILayout . ObjectField ( "Target Folder" ,
357+ targetFolder ,
358+ typeof ( DefaultAsset ) , false ) ;
346359
347- if ( overwriteStaticFileLocation )
348- {
349- DefaultAsset targetFolder = AssetDatabase . LoadAssetAtPath < DefaultAsset > (
350- ScriptableObjectCollectionSettings . Instance . GetStaticFileFolderForCollection (
351- collection ) ) ;
352- using ( EditorGUI . ChangeCheckScope changeCheck = new EditorGUI . ChangeCheckScope ( ) )
360+ if ( changeCheck . changed )
353361 {
354- targetFolder = ( DefaultAsset ) EditorGUILayout . ObjectField ( "Target Folder" ,
355- targetFolder ,
356- typeof ( DefaultAsset ) , false ) ;
357-
358- if ( changeCheck . changed )
359- {
360- ScriptableObjectCollectionSettings . Instance . SetStaticFileFolderForCollection (
361- collection ,
362- AssetDatabase . GetAssetPath ( targetFolder ) ) ;
363- }
362+ ScriptableObjectCollectionSettings . Instance . SetStaticFileFolderForCollection (
363+ collection ,
364+ AssetDatabase . GetAssetPath ( targetFolder ) ) ;
364365 }
365366 }
366-
367- EditorGUI . indentLevel -- ;
368367 }
369368
370- EditorGUILayout . EndFoldoutHeaderGroup ( ) ;
369+ EditorGUI . indentLevel -- ;
371370 }
372371 }
373372 }
0 commit comments