public void PlayOneShotSound(string path, Transform transform) { EventInstance soundEvent = RuntimeManager.CreateInstance(path); if (!soundEvent.Equals(null)) { soundEvent.set3DAttributes(RuntimeUtils.To3DAttributes(transform.position)); soundEvent.start(); SoundManagerMovingSound movingSound = new SoundManagerMovingSound(transform, soundEvent); positionEvents.Add(movingSound); soundEvent.release(); } }
public EventInstance PlayEvent(string path, Transform transform) { EventInstance soundEvent = RuntimeManager.CreateInstance(path); if (!soundEvent.Equals(null)) { soundEvent.set3DAttributes(RuntimeUtils.To3DAttributes(transform.position)); soundEvent.start(); SoundManagerMovingSound movingSound = new SoundManagerMovingSound(transform, soundEvent); positionEvents.Add(movingSound); eventsList.Add(soundEvent); } return(soundEvent); }