We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0b7fd1 commit 2ea862aCopy full SHA for 2ea862a
Storage.cs
@@ -1,11 +1,11 @@
1
-using System.Linq;
+using System.Linq;
2
using UnityEngine;
3
4
namespace ToolBox.Loader
5
{
6
public static class Storage
7
8
- private static ILoadable[] _assets = null;
+ private static ScriptableObject[] _assets = null;
9
10
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
11
private static void Setup()
@@ -17,11 +17,10 @@ private static void Setup()
17
#endif
18
_assets = assets
19
.Where(x => x is ILoadable)
20
- .Cast<ILoadable>()
21
.ToArray();
22
}
23
24
- public static T Get<T>() where T : ILoadable
+ public static T Get<T>() where T : ScriptableObject, ILoadable
25
26
for (int i = 0; i < _assets.Length; i++)
27
if (_assets[i] is T asset)
0 commit comments