internal void Play3D(string name, Vector3 position, float volume, float pitch) { Sound sound = bank.GetSound(name); if (sound == null) { return; } SoundBus bus = sound.Bus; if (bus == null) { bus = bank.DefaultBus; } SoundBusRuntime runtime = null; if (!busRuntimes.TryGetValue(bus, out runtime)) { return; } SoundInstance instance = runtime.GrabSound(sound); if (instance == null) { return; } instance.Play3D(position, volume, pitch); }
internal void UnPause() { Dictionary <SoundBus, SoundBusRuntime> .Enumerator enumerator = busRuntimes.GetEnumerator(); while (enumerator.MoveNext()) { SoundBusRuntime runtime = enumerator.Current.Value; runtime.UnPause(); } }
private void Update() { Dictionary <SoundBus, SoundBusRuntime> .Enumerator enumerator = busRuntimes.GetEnumerator(); while (enumerator.MoveNext()) { SoundBusRuntime runtime = enumerator.Current.Value; runtime.Update(bank); } }
public void Init(SoundBank bank_) { busRuntimes.Clear(); bank = bank_; foreach (SoundBus bus in bank.Buses) { SoundBusRuntime busRuntime = new SoundBusRuntime(transform, bus); busRuntimes.Add(bus, busRuntime); } }