File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public static T instance
47
47
{
48
48
if ( ScriptableSingleton < T > . s_Instance == null )
49
49
{
50
- ScriptableSingleton < T > . CreateAndLoad ( ) ;
50
+ return ScriptableSingleton < T > . CreateAndLoad ( ) ;
51
51
}
52
52
return ScriptableSingleton < T > . s_Instance ;
53
53
}
@@ -60,22 +60,23 @@ protected ScriptableSingleton()
60
60
Debug . LogError ( "ScriptableSingleton already exists. Did you query the singleton in a constructor?" ) ;
61
61
}
62
62
}
63
- private static void CreateAndLoad ( )
63
+ private static T CreateAndLoad ( )
64
64
{
65
65
string filePath = ScriptableSingleton < T > . GetFilePath ( ) ;
66
66
if ( ! string . IsNullOrEmpty ( filePath ) )
67
67
{
68
68
var loaded = InternalEditorUtility . LoadSerializedFileAndForget ( filePath ) ;
69
+
69
70
if ( loaded . Length > 0 ) {
70
71
ScriptableSingleton < T > . s_Instance = loaded [ 0 ] as T ;
71
- return ;
72
72
}
73
73
}
74
74
if ( ScriptableSingleton < T > . s_Instance == null )
75
75
{
76
76
T t = ScriptableObject . CreateInstance < T > ( ) ;
77
77
ScriptableSingleton < T > . s_Instance = t ;
78
78
}
79
+ return ScriptableSingleton < T > . s_Instance ;
79
80
}
80
81
protected virtual void Save ( bool saveAsText )
81
82
{
You can’t perform that action at this time.
0 commit comments