public void Stop(AudioChannel channel = AudioChannel.Action) { FMOD_StudioEventEmitter emitter = this.GetEmitter(channel); if (emitter != null) { emitter.Stop(STOP_MODE.ALLOWFADEOUT); } }
public static bool PlayEmitter(string estring) //Called To Play A Sound From Designated Emitter { FMOD_StudioEventEmitter EmitterToPlay = (FMOD_StudioEventEmitter)emitterlist[estring]; EmitterToPlay.Stop(); //Stop Sound EmitterToPlay.Play(); //Play Sound return(true); }
public override void Awake() { FMOD_StudioEventEmitter fMOD_StudioEventEmitter = (FMOD_StudioEventEmitter)this.GetComponent(typeof(FMOD_StudioEventEmitter)); this.WindDice = UnityEngine.Random.Range(0, 4); this.WindDiceStop = UnityEngine.Random.Range(0, 3); if (this.WindDice == 2 && !this.Playing) { this.Playing = true; fMOD_StudioEventEmitter.Play(); } else if (this.WindDiceStop == 2 && this.Playing) { this.Playing = false; fMOD_StudioEventEmitter.Stop(); } }
private void ShutdownFire() { foreach (GameObject gameObject in this.fires) { if (gameObject) { ParticleSystem component = gameObject.GetComponent <ParticleSystem>(); if (component) { component.Stop(true, ParticleSystemStopBehavior.StopEmitting); } FMOD_StudioEventEmitter component2 = gameObject.GetComponent <FMOD_StudioEventEmitter>(); if (component2) { component2.Stop(); } } } }