File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ public static T LoadOrCreateInstance()
2121 {
2222 if ( ! TryToLoadInstance ( out T resultInstance ) )
2323 {
24- #if UNITY_EDITOR
24+ #if ! UNITY_EDITOR
25+ return null ;
26+ #else
2527 resultInstance = CreateInstance < T > ( ) ;
2628
2729 AssetDatabaseUtils . CreatePathIfDontExist ( "Assets/Resources" ) ;
@@ -30,18 +32,17 @@ public static T LoadOrCreateInstance()
3032 UnityEditor . AssetDatabase . Refresh ( ) ;
3133 return resultInstance ;
3234#endif
33- return null ;
3435 }
3536
3637 return resultInstance ;
3738 }
3839
3940 public static bool Exist ( )
4041 {
41- return TryToLoadInstance < T > ( out _ ) ;
42+ return TryToLoadInstance ( out _ ) ;
4243 }
4344
44- private static bool TryToLoadInstance < T > ( out T result ) where T : ScriptableObject
45+ private static bool TryToLoadInstance ( out T result )
4546 {
4647 T newInstance = Resources . Load < T > ( typeof ( T ) . Name ) ;
4748
You can’t perform that action at this time.
0 commit comments