示例#1
0
 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));
         }
     }
 }
示例#2
0
 protected virtual SubtitlePanelNumber GetSubtitlePanelNumberFromPanel(StandardUISubtitlePanel panel)
 {
     if (panel == m_defaultNPCPanel || panel == m_defaultPCPanel)
     {
         return(SubtitlePanelNumber.Default);
     }
     for (int i = 0; i < m_builtinPanels.Count; i++)
     {
         if (panel == m_builtinPanels[i])
         {
             return(PanelNumberUtility.IntToSubtitlePanelNumber(i));
         }
     }
     return(SubtitlePanelNumber.Custom);
 }
        protected StandardUIMenuPanel GetPanelFromNumber(MenuPanelNumber menuPanelNumber, StandardUIMenuPanel customMenuPanel)
        {
            switch (menuPanelNumber)
            {
            case MenuPanelNumber.Default:
                return(m_defaultPanel);

            case MenuPanelNumber.Custom:
                return(customMenuPanel);

            default:
                var index = PanelNumberUtility.GetMenuPanelIndex(menuPanelNumber);
                return((0 <= index && index < m_builtinPanels.Count) ? m_builtinPanels[index] : null);
            }
        }
示例#4
0
        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);
            }
        }
示例#5
0
        private StandardUIMenuPanel GetDialogueActorPanel(DialogueActor dialogueActor)
        {
            if (dialogueActor == null)
            {
                return(null);
            }
            switch (dialogueActor.standardDialogueUISettings.menuPanelNumber)
            {
            case MenuPanelNumber.Default:
                return(m_defaultPanel);

            case MenuPanelNumber.Custom:
                return(dialogueActor.standardDialogueUISettings.customMenuPanel);

            default:
                var index = PanelNumberUtility.GetMenuPanelIndex(dialogueActor.standardDialogueUISettings.menuPanelNumber);
                return((0 <= index && index < m_builtinPanels.Count) ? m_builtinPanels[index] : null);
            }
        }