Exemplo n.º 1
0
        public void Show(TDBaseTalkData talkData, TDBaseTalkFragment talkFragment)
        {
            CurTalkData     = talkData;
            CurTalkFragment = talkFragment;
            Show(true, true);

            if (Icon != null)
            {
                Icon.Icon.overrideSprite = GetIcon(talkData, talkFragment);
            }
            if (Name != null)
            {
                Name.NameText = GetName(talkData, talkFragment);
            }
            if (PreAudioSource != null)
            {
                PreAudioSource.Stop();
            }
            PreAudioSource = PlayClip(GetAudio(talkData, talkFragment));

            Desc.NameText    = "";
            Desc.IsAnimation = false;
            if (Tween != null)
            {
                Tween.Kill();
            }
            Tween = DOTween.To(() =>
                               Desc.RichName.Content, (x) => Desc.RichName.Content = x, talkFragment.GetDesc(), 0.5f)
                    .SetDelay(0.5f)
                    .OnComplete(OnTypeEnd)
                    .OnStart(OnTweenStart);

            bool isHaveOpt = talkData.IsHaveOption() && talkFragment.IsLasted;

            DP_Select.Show(isHaveOpt);
            if (isHaveOpt)
            {
                TextLayoutElement.minHeight = 50.0f;
            }
            else
            {
                TextLayoutElement.minHeight = 100.0f;
            }
        }
Exemplo n.º 2
0
 protected void Show(TDBaseTalkData talkData, TDBaseTalkFragment fragment)
 {
     ShowOff();
     if (fragment.Type == TalkType.Left)
     {
         LeftItem.Trans.SetAsLastSibling();
         LeftItem.Show(talkData, fragment);
     }
     else if (fragment.Type == TalkType.Right)
     {
         RightItem.Trans.SetAsLastSibling();
         RightItem.Show(talkData, fragment);
     }
     else if (fragment.Type == TalkType.Mid)
     {
         MidItem.Trans.SetAsLastSibling();
         MidItem.Show(talkData, fragment);
     }
 }
Exemplo n.º 3
0
 protected virtual string GetAudio(TDBaseTalkData talkData, TalkFragment talkFragment)
 {
     return(talkFragment.Audio);
 }
Exemplo n.º 4
0
 protected virtual string GetName(TDBaseTalkData talkData, TalkFragment talkFragment)
 {
     return(talkFragment.GetName());
 }
Exemplo n.º 5
0
 protected virtual Sprite GetIcon(TDBaseTalkData talkData, TalkFragment talkFragment)
 {
     return(talkFragment.GetIcon());
 }