コード例 #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);
        }
コード例 #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.
        }
コード例 #3
0
ファイル: EventPaths.cs プロジェクト: Danny-vD/LurkingMonster
        private string GetPathForEmitter(EmitterType emitterType)
        {
            EventType eventType = emitterEvents.First(item => item.Key == emitterType).Value;

            return(GetPath(eventType));
        }
コード例 #4
0
ファイル: EventPaths.cs プロジェクト: Danny-vD/LurkingMonster
 public string GetPath(EventType eventType)
 {
     return(events.First(item => item.Key.Equals(eventType)).Value);
 }
コード例 #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)));
 }
コード例 #6
0
 public static void PlayOneShot2D(EventType @event)
 {
     RuntimeManager.PlayOneShot(AudioManager.Instance.EventPaths.GetPath(@event));
 }
コード例 #7
0
 public static void PlayOneShot3D(EventType @event)
 {
     RuntimeManager.PlayOneShotAttached(AudioManager.Instance.EventPaths.GetPath(@event), AudioManager.Instance.gameObject);
 }
コード例 #8
0
 public static void PlayOneShotAttached(EventType @event, GameObject location)
 {
     RuntimeManager.PlayOneShotAttached(AudioManager.Instance.EventPaths.GetPath(@event), location);
 }