public void PlayVoice(VoiceTone voiceTone = VoiceTone.Normal) { switch (voiceTone) { case VoiceTone.Normal: normal.PlayRandom(); break; case VoiceTone.Angry: angry.PlayRandom(); break; case VoiceTone.Gentle: gentle.PlayRandom(); break; case VoiceTone.Helpless: helpless.PlayRandom(); break; case VoiceTone.Question: question.PlayRandom(); break; case VoiceTone.Surprised: surprised.PlayRandom(); break; default: throw new ArgumentOutOfRangeException(nameof(voiceTone), voiceTone, null); } }
public IEnumerator Say(string line, float duration, float waitBefore = 0, float waitAfter = 0, VoiceTone voiceTone = default) { transform.parent.GetComponentInChildren <VoiceManager>() .PlayVoice(voiceTone == default ? VoiceTone.Normal : voiceTone); yield return(AnimateSpeechBubble(line, duration, waitBefore, waitAfter)); }
public void SayNow(string line, float duration, float waitBefore = 0, float waitAfter = 0, VoiceTone voiceTone = default) { transform.parent.GetComponentInChildren <VoiceManager>() .PlayVoice(voiceTone == default ? VoiceTone.Normal : voiceTone); StartCoroutine(Say(line, duration, waitBefore, waitAfter)); }