protected void BarkNextCachedLine(Transform speaker, Transform listener) { if ((barkUI != null) && (cachedState != null) && cachedState.hasAnyResponses) { Response[] responses = cachedState.hasNPCResponse ? cachedState.npcResponses : cachedState.pcResponses; int index = (barkHistory ?? new BarkHistory(BarkOrder.Random)).GetNextIndex(responses.Length); DialogueEntry barkEntry = responses[index].destinationEntry; if ((barkEntry == null) && DialogueDebug.logWarnings) { Debug.Log(string.Format("{0}: Bark (speaker={1}, listener={2}): '{3}' bark entry is null", new System.Object[] { DialogueDebug.Prefix, speaker, listener, conversation }), speaker); } if (barkEntry != null) { Subtitle subtitle = new Subtitle(cachedState.subtitle.listenerInfo, cachedState.subtitle.speakerInfo, new FormattedText(barkEntry.currentDialogueText), string.Empty, string.Empty, barkEntry); if (DialogueDebug.logInfo) { Debug.Log(string.Format("{0}: Bark (speaker={1}, listener={2}): '{3}'", new System.Object[] { DialogueDebug.Prefix, speaker, listener, subtitle.formattedText.text }), speaker); } if (barkGroupMember != null) { barkGroupMember.GroupBarkString(subtitle.formattedText.text, listener, subtitle.sequence); } else { StartCoroutine(BarkController.Bark(subtitle, speaker, listener, barkUI)); } } } }
public void ShowSubtitle(Subtitle subtitle) { // Use the bark UI to show the subtitle, don't tell it to skip // the sequence since the ConversationView will already play it: StartCoroutine(BarkController.Bark(subtitle, true)); }