private IEnumerator RunSound(BattleAnimationSound sound, bool dummy = false) { Pause(); yield return(Display.PlayAndWait(sound, Display.Variables)); Unpause(); }
private AudioClip GetSound(BattleAnimationSound animation, IVariableStore variables) { AudioClip sound = null; switch (animation.SoundSource) { case BattleAnimationSource.Display: Sounds.TryGetValue(animation.Sound, out sound); break; case BattleAnimationSource.Variables: variables.GetVariable(animation.Sound).TryGetObject(out sound); break; } return(sound); }
public void Play(BattleAnimationSound animation, IVariableStore variables) { var sound = GetSound(animation, variables); if (sound) { BattlerAudio.PlaySound(sound, 1.0f); } else { Debug.LogWarningFormat(this, _missingSoundWarning, animation.Sound, animation.SoundSource); } }
public IEnumerator PlayAndWait(BattleAnimationSound animation, IVariableStore variables) { var sound = GetSound(animation, variables); if (sound) { yield return(BattlerAudio.PlaySoundAndWait(sound, 1.0f)); } else { Debug.LogWarningFormat(this, _missingSoundWarning, animation.Sound, animation.SoundSource); } }