Right now I have a dialogue system that will print each letter for a dialogue with a frames worth of wait time in between each letter. I want to play a sound effect after each letter is printed out to create a cool dialogue effect. This is how it looks now:
IEnumerator TypeSentence (string sentence)
{
dialogueText.text = "";
foreach(char letter in sentence.ToCharArray())
{
sound.Play();
dialogueText.text += letter;
yield return null;
}
}
This plays the sound effect put only when all the letters are done being typed. Any suggestions? is there a different way to do this? Thank you!