You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
478 B
22 lines
478 B
using UnityEngine;
|
|
|
|
public class ScriptableSingleton<T> : ScriptableObject where T : ScriptableObject
|
|
{
|
|
static readonly string _scriptableObjectPath = "ScriptableObject/Global/";
|
|
|
|
protected static T _instance = null;
|
|
public static T Instance
|
|
{
|
|
get
|
|
{
|
|
if (_instance is null)
|
|
{
|
|
_instance = Resources.Load<T>(_scriptableObjectPath + typeof(T));
|
|
}
|
|
|
|
return _instance;
|
|
}
|
|
}
|
|
}
|
|
|
|
|