Skip to content

Commit 98c94b4

Browse files
authored
Update Storage.cs
1 parent de46b76 commit 98c94b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Storage.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ private static void Setup()
2222

2323
public static T Get<T>() where T : ScriptableObject, ILoadable
2424
{
25+
#if UNITY_EDITOR
26+
if (!Application.isPlaying)
27+
_assets = Resources.FindObjectsOfTypeAll<ScriptableObject>();
28+
#endif
29+
2530
for (int i = 0; i < _assets.Length; i++)
2631
if (_assets[i] is T asset)
2732
return asset;
2833

29-
return default;
34+
return null;
3035
}
3136
}
3237

0 commit comments

Comments
 (0)