////////////////////////////////////////////////////////////////////////// void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { UnityEngine.Debug.LogError("[Accessibility] Trying to create another MacOS TTS instance, when there already is one."); DestroyImmediate(this); return; } }
////////////////////////////////////////////////////////////////////////// void Start() { if (instance == null) { instance = this; // No longer needed, because this is now a child of the Accessibility Manager, which is already set to DontDestroyOnLoad //DontDestroyOnLoad(gameObject); } else { UnityEngine.Debug.LogError("[Accessibility] Trying to create another MacOS TTS instance, when there already is one."); DestroyImmediate(gameObject); return; } }