示例#1
0
        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);
        }
示例#2
0
 internal void UnPause()
 {
     Dictionary <SoundBus, SoundBusRuntime> .Enumerator enumerator = busRuntimes.GetEnumerator();
     while (enumerator.MoveNext())
     {
         SoundBusRuntime runtime = enumerator.Current.Value;
         runtime.UnPause();
     }
 }
示例#3
0
 private void Update()
 {
     Dictionary <SoundBus, SoundBusRuntime> .Enumerator enumerator = busRuntimes.GetEnumerator();
     while (enumerator.MoveNext())
     {
         SoundBusRuntime runtime = enumerator.Current.Value;
         runtime.Update(bank);
     }
 }
示例#4
0
        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);
            }
        }