/// <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); }
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. }
private string GetPathForEmitter(EmitterType emitterType) { EventType eventType = emitterEvents.First(item => item.Key == emitterType).Value; return(GetPath(eventType)); }
public string GetPath(EventType eventType) { return(events.First(item => item.Key.Equals(eventType)).Value); }
/// <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))); }
public static void PlayOneShot2D(EventType @event) { RuntimeManager.PlayOneShot(AudioManager.Instance.EventPaths.GetPath(@event)); }
public static void PlayOneShot3D(EventType @event) { RuntimeManager.PlayOneShotAttached(AudioManager.Instance.EventPaths.GetPath(@event), AudioManager.Instance.gameObject); }
public static void PlayOneShotAttached(EventType @event, GameObject location) { RuntimeManager.PlayOneShotAttached(AudioManager.Instance.EventPaths.GetPath(@event), location); }