Esempio n. 1
0
        /// <summary>
        /// Returns an instance of the specified event with given parameters, you will need to start, stop and release it manually
        /// </summary>
        public static EventInstance GetEventInstance(EventType @event, EventParameters parameters)
        {
            EventInstance eventInstance = RuntimeManager.CreateInstance(AudioManager.Instance.EventPaths.GetPath(@event));

            foreach (KeyValuePair <string, float> pair in parameters.Parameters)
            {
                eventInstance.setParameterByName(pair.Key, pair.Value);
            }

            return(eventInstance);
        }
Esempio n. 2
0
        public static void PlayOneShot(EventType @event, EventParameters parameters)
        {
            EventInstance eventInstance = RuntimeManager.CreateInstance(AudioManager.Instance.EventPaths.GetPath(@event));

            foreach (KeyValuePair <string, float> pair in parameters.Parameters)
            {
                eventInstance.setParameterByName(pair.Key, pair.Value);
            }

            eventInstance.start();
            eventInstance.release();             //Release each event instance immediately, they are fire and forget, one-shot instances.
        }
Esempio n. 3
0
        private string GetPathForEmitter(EmitterType emitterType)
        {
            EventType eventType = emitterEvents.First(item => item.Key == emitterType).Value;

            return(GetPath(eventType));
        }
Esempio n. 4
0
 public string GetPath(EventType eventType)
 {
     return(events.First(item => item.Key.Equals(eventType)).Value);
 }
Esempio n. 5
0
 /// <summary>
 /// Returns an instance of the specified event, you will need to start, stop and release it manually
 /// </summary>
 public static EventInstance GetEventInstance(EventType @event)
 {
     return(RuntimeManager.CreateInstance(AudioManager.Instance.EventPaths.GetPath(@event)));
 }
Esempio n. 6
0
 public static void PlayOneShot2D(EventType @event)
 {
     RuntimeManager.PlayOneShot(AudioManager.Instance.EventPaths.GetPath(@event));
 }
Esempio n. 7
0
 public static void PlayOneShot3D(EventType @event)
 {
     RuntimeManager.PlayOneShotAttached(AudioManager.Instance.EventPaths.GetPath(@event), AudioManager.Instance.gameObject);
 }
Esempio n. 8
0
 public static void PlayOneShotAttached(EventType @event, GameObject location)
 {
     RuntimeManager.PlayOneShotAttached(AudioManager.Instance.EventPaths.GetPath(@event), location);
 }