We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de46b76 commit 98c94b4Copy full SHA for 98c94b4
1 file changed
Storage.cs
@@ -22,11 +22,16 @@ private static void Setup()
22
23
public static T Get<T>() where T : ScriptableObject, ILoadable
24
{
25
+#if UNITY_EDITOR
26
+ if (!Application.isPlaying)
27
+ _assets = Resources.FindObjectsOfTypeAll<ScriptableObject>();
28
+#endif
29
+
30
for (int i = 0; i < _assets.Length; i++)
31
if (_assets[i] is T asset)
32
return asset;
33
- return default;
34
+ return null;
35
}
36
37
0 commit comments