Answer the question
In order to leave comments, you need to log in
Resources.FindObjectsOfTypeAll not working on Unity startup?
I want to make a singleton based on ScrictableObject.
public abstract class ScriptableSingleton<T> : ScriptableObject where T : ScriptableObject {
static T _instance = null;
public static T Instance
{
get
{
if (!_instance)
_instance = Resources.FindObjectsOfTypeAll<T>().FirstOrDefault();
return _instance;
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question