void OnDisable() { if (Instance == this) { Instance = null; } }
/// <summary> /// Returns an instance of the Audio2dListener /// </summary> /// <returns></returns> public static Audio2DListener GetInstance() { if (Instance == null) { // create a new one var found = FindObjectOfType <AudioListener>(); if (found == null) { Debug.LogError("No AudioListener found !"); return(null); } Instance = found.gameObject.AddComponent <Audio2DListener>(); } return(Instance); }
/// <summary> /// Returns an instance of the Audio2dListener /// </summary> /// <returns></returns> public static Audio2DListener GetInstance() { if (Instance == null) { // create a new one var found = FindObjectOfType<AudioListener>(); if (found == null) { Debug.LogError("No AudioListener found !"); return null; } Instance = found.gameObject.AddComponent<Audio2DListener>(); } return Instance; }
void OnEnable() { Instance = this; }
void OnEnable() { Instance = this; }
void OnDisable() { if (Instance == this) Instance = null; }