Skip to content

Commit 8514ad1

Browse files
authored
Merge pull request #14 from Unity-Technologies/Uni-20890-fbxexport-settings-fail-to-get
Uni-20890 return new ExportSettings when we fail to get
2 parents 1752cb2 + 4a9dd88 commit 8514ad1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static T instance
4747
{
4848
if (ScriptableSingleton<T>.s_Instance == null)
4949
{
50-
ScriptableSingleton<T>.CreateAndLoad();
50+
return ScriptableSingleton<T>.CreateAndLoad();
5151
}
5252
return ScriptableSingleton<T>.s_Instance;
5353
}
@@ -60,22 +60,23 @@ protected ScriptableSingleton()
6060
Debug.LogError("ScriptableSingleton already exists. Did you query the singleton in a constructor?");
6161
}
6262
}
63-
private static void CreateAndLoad()
63+
private static T CreateAndLoad()
6464
{
6565
string filePath = ScriptableSingleton<T>.GetFilePath();
6666
if (!string.IsNullOrEmpty(filePath))
6767
{
6868
var loaded = InternalEditorUtility.LoadSerializedFileAndForget(filePath);
69+
6970
if (loaded.Length > 0) {
7071
ScriptableSingleton<T>.s_Instance = loaded [0] as T;
71-
return;
7272
}
7373
}
7474
if (ScriptableSingleton<T>.s_Instance == null)
7575
{
7676
T t = ScriptableObject.CreateInstance<T>();
7777
ScriptableSingleton<T>.s_Instance = t;
7878
}
79+
return ScriptableSingleton<T>.s_Instance;
7980
}
8081
protected virtual void Save(bool saveAsText)
8182
{

0 commit comments

Comments
 (0)