void UpdateMuted() { for (int s = 0; s < allSources.Count; s++) { FXSource source = allSources[s]; source.audioSource.mute = _isMuted; } for (int e = 0; e < extraAudioSources.Count; e++) { extraAudioSources[e].mute = _isMuted; } basicAudioSource.mute = _isMuted; }
FXSource GetNextSource() { int sourceCount = allSources.Count; for(int s = 0;s<sourceCount;s++) { FXSource source = allSources[s]; if(!source.audioSource.isPlaying) { return source; } } FXSource newSource = new FXSource(); allSources.Add(newSource); newSource.audioSource = gameObject.AddComponent<AudioSource>(); return newSource; }