public static void Initialize() { if (_instance == null) { // Initializing the ScriptableSystemsManager var found = Resources.LoadAll <ScriptableSystemsManager>("Systems"); _instance = found.FirstOrDefault(); #if UNITY_EDITOR _instance?.Awake(); #endif } if (_instance == null) { Debug.LogWarning("ScriptableObjectSingleton: Failed to find a ScriptableObject asset of type ScriptableSystemsManager, creating a temporary runtime-only instance."); _instance = CreateInstance <ScriptableSystemsManager>(); #if UNITY_EDITOR _instance?.Awake(); #endif } }
public static void Initialize() { if (_instance == null) { // Initializing the ScriptableSystemsManager var found = Resources.LoadAll <ScriptableSystemsManager>("Systems"); _instance = found.FirstOrDefault(); #if UNITY_EDITOR _instance?.Awake(); #endif } if (_instance == null) { _instance = CreateNewInstance(); Debug.Log("ScriptableSystemsManager: Created a ScriptableSystemsManager instance in Assets/Resources/Systems."); #if UNITY_EDITOR _instance?.Awake(); #endif } }