ShallowAudioSource MemberPlay(AudioClip clip, Vector2 location, bool loop = false, BeatValue beat = DEFAULT_BEAT, float volume = 1.0f) { ShallowAudioSource source = GetShallowAudioSource(clip); source.loop = loop; source.position = location; source.volume = volume; source.Start(beat); return(source); }
ShallowAudioSource GetShallowAudioSource(AudioClip clip) { AudioSource source = GetAudioSource(true, 1.0f); source.clip = clip; ShallowAudioSource shallowSource = new ShallowAudioSource(source); if (!shallowAudioSources.ContainsKey(source)) { shallowAudioSources.Add(source, shallowSource); } else { shallowAudioSources[source] = shallowSource; } return(shallowSource); }