static void UpdateFadingSources(float deltaTime) { for (int i = fadingAudioSources.Count - 1; i >= 0; i--) { FadingAudioSource fas = fadingAudioSources[i]; if (fas.UpdateSource(deltaTime)) { fadingAudioSources.Remove(fas); sourceToFadingAudioSource.Remove(fas.source.GetInstanceID()); } } }
static bool SourceIsFading(AudioSource source, out FadingAudioSource fas) { return(sourceToFadingAudioSource.TryGetValue(source.GetInstanceID(), out fas)); }