private static AudioSource GetNextAudioSource() { foreach (var audioSource in _audioSources) { if (audioSource.isPlaying == false) { return(audioSource); } } DevdogLogger.LogWarning("All sources taken, can't play audio clip..."); return(null); }
/// <summary> /// Plays an audio clip, only use this for the UI, it is not pooled so performance isn't superb. /// </summary> public static void AudioPlayOneShot(AudioClipInfo clip) { if (clip == null || clip.audioClip == null) { return; } if (instance == null) { DevdogLogger.LogWarning("AudioManager not found, yet trying to play an audio clip...."); } if (_audioQueue.Any(o => o.audioClip == clip.audioClip) == false) { _audioQueue.Enqueue(clip); } }