@@ -36,21 +36,21 @@ public class UnityEventHelperSettings : ScriptableObject
3636 "scan whole project via Tools/UnityEventHelper/Scan Project command" ) ]
3737 private ObservableProperty < bool > _isHighlightingEnabled = true ;
3838
39- [ SerializeField ] private ObservableProperty < Color > _validCallColor = new Color ( 0 , 1 , 0 , 0.25f ) ;
39+ [ SerializeField ] private ObservableProperty < Color > _validCallColor = new Color ( 0 , 1 , 0 , 0.25f ) ;
4040 [ SerializeField ] private ObservableProperty < Color > _invalidCallColor = new Color ( 1 , 0 , 0 , 0.25f ) ;
4141
42- public ObservableProperty < bool > IsTrackingEnabled => _isTrackingEnabled ;
43- public ObservableProperty < bool > IsHighlightingEnabled => _isHighlightingEnabled ;
44- public bool OpenWindowAutomatically => _openWindowAutomatically ;
45- public ObservableProperty < Color > ValidCallColor => _validCallColor ;
46- public ObservableProperty < Color > InvalidCallColor => _invalidCallColor ;
47-
42+ public ObservableProperty < bool > IsTrackingEnabled => _isTrackingEnabled ;
43+ public ObservableProperty < bool > IsHighlightingEnabled => _isHighlightingEnabled ;
44+ public bool OpenWindowAutomatically => _openWindowAutomatically ;
45+ public ObservableProperty < Color > ValidCallColor => _validCallColor ;
46+ public ObservableProperty < Color > InvalidCallColor => _invalidCallColor ;
47+
4848 public bool InInitialScanComplete
4949 {
5050 get => PlayerPrefs . GetInt ( "UnityEventHelperSettings_InInitialScanComplete" , 0 ) == 1 ;
5151 set => PlayerPrefs . SetInt ( "UnityEventHelperSettings_InInitialScanComplete" , value ? 1 : 0 ) ;
5252 }
53-
53+
5454 [ MenuItem ( "Tools/UnityEventTracker/Show Settings" ) ]
5555 public static void ShowUnityEventHelperSettings ( )
5656 {
@@ -66,6 +66,7 @@ public bool ShouldSkipFolder(string relativePath)
6666 }
6767
6868 private static UnityEventHelperSettings _instance ;
69+
6970 public static UnityEventHelperSettings Instance ( )
7071 {
7172 if ( _instance != null )
@@ -79,26 +80,28 @@ public static UnityEventHelperSettings Instance()
7980
8081 return _instance ;
8182 }
82-
83- private const string SettingsPath = "Plugins/UnityEventHelper/UnityEventHelperSettings.asset" ;
83+
8484 private static UnityEventHelperSettings CreateDefaultSettings ( )
8585 {
8686 var instance = CreateInstance < UnityEventHelperSettings > ( ) ;
8787
88- CreateRootDirectory ( ) ;
88+ var path = CreateRootDirectory ( ) ;
8989
90- AssetDatabase . CreateAsset ( instance , SettingsPath ) ;
90+ var filePath = Path . Combine ( path , "UnityEventHelperSettings.asset" ) ;
91+ AssetDatabase . CreateAsset ( instance , filePath ) ;
9192 AssetDatabase . SaveAssets ( ) ;
9293 return instance ;
9394 }
9495
95- private static void CreateRootDirectory ( )
96+ private static string CreateRootDirectory ( )
9697 {
97- var fullPath = Path . Combine ( Application . dataPath , SettingsPath ) ;
98+ const string settingsPath = "Plugins/UnityEventHelper" ;
99+ var fullPath = Path . Combine ( Application . dataPath , settingsPath ) ;
98100
99- if ( Directory . Exists ( fullPath ) ) return ;
101+ if ( ! Directory . Exists ( fullPath ) )
102+ Directory . CreateDirectory ( fullPath ) ;
100103
101- Directory . CreateDirectory ( fullPath ) ;
104+ return fullPath . Substring ( fullPath . IndexOf ( "Assets" , StringComparison . InvariantCulture ) ) ;
102105 }
103106 }
104- }
107+ }
0 commit comments