11using System . Collections ;
22using System . IO ;
3+
34using Unity . EditorCoroutines . Editor ;
45using UnityEditor ;
56using UnityEngine ;
@@ -91,15 +92,15 @@ private static void ManageSceneViewCore(IToolboxSceneViewSettings settings)
9192
9293 private static string GetSettingsFileGuid ( )
9394 {
94- var guids = AssetDatabase . FindAssets ( "t:" + settingsType ) ;
95+ var guids = AssetDatabase . FindAssets ( $ "t:{ settingsType } " ) ;
9596 string targetGuid = null ;
9697 //try to find a settings file in a non-package directory
9798 for ( var i = guids . Length - 1 ; i >= 0 ; i -- )
9899 {
99100 var guid = guids [ i ] ;
100101 var path = AssetDatabase . GUIDToAssetPath ( guid ) ;
101102 targetGuid = guid ;
102- if ( path . StartsWith ( "Assets" ) )
103+ if ( ! IsDefaultSettingsPath ( path ) )
103104 {
104105 break ;
105106 }
@@ -108,6 +109,11 @@ private static string GetSettingsFileGuid()
108109 return targetGuid ;
109110 }
110111
112+ private static bool IsDefaultSettingsPath ( string path )
113+ {
114+ return path . StartsWith ( "Packages" ) ;
115+ }
116+
111117 [ InitializeOnLoadMethod ]
112118 internal static void InitializeToolbox ( )
113119 {
@@ -223,7 +229,7 @@ void ReintializeProvider()
223229 AssetDatabase . SaveAssets ( ) ;
224230 AssetDatabase . Refresh ( ) ;
225231
226- ToolboxEditorLog . LogInfo ( "Created a settings file at - " + relativePath ) ;
232+ ToolboxEditorLog . LogInfo ( $ "Created a settings file at - { relativePath } " ) ;
227233
228234 ReintializeProvider ( ) ;
229235 }
@@ -232,7 +238,13 @@ void ReintializeProvider()
232238 }
233239
234240 EditorGUILayout . Space ( ) ;
235- EditorGUILayout . LabelField ( "Settings file location - " + SettingsPath ) ;
241+ EditorGUILayout . LabelField ( $ "Settings file location - { SettingsPath } ") ;
242+ if ( IsDefaultSettingsPath ( SettingsPath ) )
243+ {
244+ EditorGUILayout . HelpBox ( "The currently displayed settings file is the default one, located in the packages directory. " +
245+ "This means all changes can be easily lost. Create a new file for better maintainability." , MessageType . Info ) ;
246+ }
247+
236248 EditorGUILayout . Space ( ) ;
237249
238250 globalSettingsEditor . OnInspectorGUI ( ) ;
0 commit comments