public void CheckSubtitleAnimator(Subtitle subtitle) { if (subtitle != null && useAnimatedPortraits && animator != null) { var dialogueActor = DialogueActor.GetDialogueActorComponent(subtitle.speakerInfo.transform); if (dialogueActor != null) // && dialogueActor.standardDialogueUISettings.portraitAnimatorController != null) { var speakerPanelNumber = dialogueActor.GetSubtitlePanelNumber(); var isMyPanel = (actorOverridingPanel == subtitle.speakerInfo.transform) || (PanelNumberUtility.GetSubtitlePanelIndex(speakerPanelNumber) == this.panelNumber) || (speakerPanelNumber == SubtitlePanelNumber.Default && subtitle.speakerInfo.isNPC && isDefaultNPCPanel) || (speakerPanelNumber == SubtitlePanelNumber.Default && subtitle.speakerInfo.isPlayer && isDefaultPCPanel) || (speakerPanelNumber == SubtitlePanelNumber.Custom && dialogueActor.standardDialogueUISettings.customSubtitlePanel == this); if (isMyPanel) { StartCoroutine(SetAnimatorAtEndOfFrame(dialogueActor.standardDialogueUISettings.portraitAnimatorController)); } } else { StartCoroutine(SetAnimatorAtEndOfFrame(null)); } } }
private StandardUISubtitlePanel GetPanelFromNumber(SubtitlePanelNumber subtitlePanelNumber, StandardUISubtitlePanel customPanel) { switch (subtitlePanelNumber) { case SubtitlePanelNumber.Default: return(null); case SubtitlePanelNumber.Custom: return(customPanel); case SubtitlePanelNumber.UseBarkUI: return(null); default: var index = PanelNumberUtility.GetSubtitlePanelIndex(subtitlePanelNumber); return((0 <= index && index < m_builtinPanels.Count) ? m_builtinPanels[index] : null); } }
private StandardUISubtitlePanel GetDialogueActorPanel(DialogueActor dialogueActor) { if (dialogueActor == null) { return(null); } switch (dialogueActor.standardDialogueUISettings.subtitlePanelNumber) { case SubtitlePanelNumber.Default: return(null); case SubtitlePanelNumber.Custom: return(dialogueActor.standardDialogueUISettings.customSubtitlePanel); case SubtitlePanelNumber.UseBarkUI: return(null); default: var index = PanelNumberUtility.GetSubtitlePanelIndex(dialogueActor.standardDialogueUISettings.subtitlePanelNumber); return((0 <= index && index < m_builtinPanels.Count) ? m_builtinPanels[index] : null); } }