This commit is contained in:
runette committed 2024-04-22 15:52:51 +01:00
commit e0afef912e
1285 files changed
+83219

No files matched your search

@@ -0,0 +1,21 @@
namespace Mapbox.Unity.Utilities
{
using System.Linq;
using UnityEngine;
public abstract class SingletonScriptableObject<T> : ScriptableObject where T : ScriptableObject
{
static T _instance = null;
public static T Instance
{
get
{
if (!_instance)
{
_instance = Resources.FindObjectsOfTypeAll<T>().FirstOrDefault();
}
return _instance;
}
}
}
}