public void DisplayBeats(List <BeatData> data) { isResuming = true; for (int i = 0; i < data.Count; i++) { if (data[i].IsClientBeat) { currentSpeaker = Speaker.Client; } else { currentSpeaker = Speaker.MainCharacter; } if (i == 0) { DisplayFirstBeat(data[i]); } else { DisplaySmsBubble(data[i]); } } OnBeatDisplayed?.Invoke(data[data.Count - 1]); isResuming = false; }
private IEnumerator DoDisplay(BeatData data, float typingTime) { while (IsBusy()) { yield return(null); //wait until dialogue is no longer busy } currentDialogueState = DialogueState.Busy; DisplayTypingBubble(); AudioManager.instance.Play("TypingSFX"); //wait time should probably create a small texting bubble yield return(new WaitForSeconds(typingTime)); typingBubble.SetActive(false); AudioManager.instance.Stop("TypingSFX"); //if there is no previous bubble assume this is the start of the conversation if (previousBubble == false) { DisplayFirstBeat(data); } //if not append from previous bubble else { DisplaySmsBubble(data); } currentDialogueState = DialogueState.Idle; OnBeatDisplayed?.Invoke(data); }
public void DisplayBeat(int id, Speaker newSpeaker) { currentSpeaker = newSpeaker; BeatData data = storyData.GetBeatById(id); //if there is no previous bubble assume this is the start of the conversation //if there is no previous bubble assume this is the start of the conversation if (previousBubble == false) { DisplayFirstBeat(data); } //if not append from previous bubble else { DisplaySmsBubble(data); } OnBeatDisplayed?.Invoke(data); }