Пример #1
0
        private void RefreshContent(string content)
        {
            if (string.IsNullOrEmpty(content))
            {
                dialogTrans.Com.gameObject.SetActive(false);
                BindModel.isPlaying.Value = false;
                return;
            }
            BindModel.isPlaying.Value = true;
            Text textCom = dialogTrans.Com.Find("Box/MsgBox/TalkMsg/Content").GetComponent <Text>();

            textCom.text           = "";
            BindModel.contentTween = textCom.DOText(content, content.Length * preWorldShowTime, true).SetEase(Ease.Linear);
            BindModel.contentTween.OnUpdate(() =>
            {
                RebuildLayout();
            });
            BindModel.contentTween.OnComplete(() =>
            {
                TweenUtil.DoDelayFunc(() =>
                {
                    RebuildLayout();
                });
                BindModel.isPlaying.Value = false;
            });
        }
Пример #2
0
 private void OnPlayingChange(bool isPlaying)
 {
     if (!isPlaying)
     {
         if (BindModel.contentTween != null)
         {
             TweenUtil.Clear(BindModel.contentTween);
             Text textCom = dialogTrans.Com.Find("Box/MsgBox/TalkMsg/Content").GetComponent <Text>();
             textCom.text           = BindModel.content.Value;
             BindModel.contentTween = null;
         }
     }
 }
Пример #3
0
 public override void OnHide()
 {
     TweenUtil.Clear(BindModel.contentTween);
     BindModel.contentTween = null;
 }