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 c981b17 commit 470f9cdCopy full SHA for 470f9cd
Config.cs
Storage.cs
@@ -0,0 +1,19 @@
1
+using UnityEngine;
2
+
3
+public static class Storage
4
+{
5
+ private static ScriptableObject[] _assets = null;
6
7
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
8
+ private static void Load() =>
9
+ _assets = Resources.LoadAll<ScriptableObject>("");
10
11
+ public static T Get<T>() where T : ScriptableObject
12
+ {
13
+ for (int i = 0; i < _assets.Length; i++)
14
+ if (_assets[i] is T asset)
15
+ return asset;
16
17
+ return null;
18
+ }
19
+}
0 commit comments