/// <summary> /// Returns TRUE if this clip is currently playing /// </summary> public bool IsPlaying() { if (clip == null) { return(false); } return(DeAudioManager.GetAudioGroup(groupId).IsPlaying(clip)); }
void OnDestroy() { if (I != this) { return; } _fadeTween.Kill(); int len = audioGroups.Length; for (int i = 0; i < len; ++i) { audioGroups[i].Dispose(); } I = null; }
void Awake() { if (I != null) { Debug.LogWarning(LogPrefix + "Multiple DeAudioManager instances were found. The newest one will be destroyed"); Destroy(this.gameObject); return; } I = this; if (this.transform.parent == null) { DontDestroyOnLoad(this.gameObject); } if (!_isInitializing) { InitializeAudioGroups(); } }
/// <summary> /// If the clip is active in an AudioSource (even if not playing) returns it, /// otherwise returns NULL /// </summary> /// <param name="ignorePaused">If TRUE ignores sources that are not playing</param> /// <param name="ignoreFadingOut">If TRUE ignores sources that are fading out</param> public DeAudioSource GetAudioSource(bool ignorePaused = false, bool ignoreFadingOut = true) { return(DeAudioManager.GetAudioGroup(groupId).GetExistingAudioSourceFor(clip, ignorePaused, ignoreFadingOut)); }
/// <summary> /// Pauses all sounds using this DeAudioClipData clip /// </summary> public void Pause() { DeAudioManager.Pause(this.clip); }
/// <summary> /// Stops all sounds using this DeAudioClipData clip /// </summary> public void Stop() { DeAudioManager.Stop(this.clip); }
/// <summary> /// Plays this DeAudioClipData /// </summary> public DeAudioSource Play() { return(DeAudioManager.Play(this)); }