private void OnDisable() { if (audioEvent != null) { audioEvent.RemoveListener(this); } }
/// <summary> /// Remove audio listener function. /// </summary> /// <param name="listener"></param> public static void RemoveAudioListener(UnityAction <AudioClip> listener) { if (eventManager == null) { return; } AudioEvent thisEvent = null; if (instance.audioEventDictionary.TryGetValue(AUDIOEVENT, out thisEvent)) { thisEvent.RemoveListener(listener); } }