示例#1
0
        public override void SetData(SmsDialogVo vo)
        {
            _data = vo;

            LayoutRebuilder.MarkLayoutForRebuild(transform.parent as RectTransform);
            RollToEnd();

            StartCoroutine(ShowWaitForInput());
        }
示例#2
0
        public SmsDialogVo Clone()
        {
            SmsDialogVo vo = new SmsDialogVo();

            vo.IsLeft      = IsLeft;
            vo.ContextText = ContextText;

            return(vo);
        }
示例#3
0
        private void AddNewItem()
        {
            SmsDialogVo data = _smsVo.dialogList[_currentIndex];

            _currentSmsItem = CreateItem(data.IsLeft);
            _currentSmsItem.SetData(data);
            _currentIndex++;

            string roleName = data.IsLeft ?  _smsVo.GetRoleName() : GlobalData.PlayerModel.PlayerVo.UserName;

            SendMessage(new Message(MessageConst.CMD_STORY_RECODE_DIALOG, Message.MessageReciverType.DEFAULT,
                                    data, roleName));
        }
示例#4
0
        public void AddDialog(object obj, string heroName)
        {
            if (stringBuilder == null)
            {
                stringBuilder = new StringBuilder();
            }

            Type type = obj.GetType();

            if (type == typeof(EntityVo))
            {
                EntityVo entity = (EntityVo)obj;
                if (entity.id == "0")
                {
                    stringBuilder.Append("【旁白】");
                }
                else
                {
                    stringBuilder.Append("【")
                    .Append(heroName)
                    .Append("】");
                }

                stringBuilder.Append(entity.dialog)
                .Append("\n\n");
            }
            else if (type == typeof(TelephoneDialogVo))
            {
                TelephoneDialogVo telDialogVo = (TelephoneDialogVo)obj;
                stringBuilder.Append("【")
                .Append(heroName)
                .Append("】");
                stringBuilder.Append(telDialogVo.Content)
                .Append("\n\n");
            }
            else if (type == typeof(SmsDialogVo))
            {
                SmsDialogVo smsDialogVo = (SmsDialogVo)obj;
                stringBuilder.Append("【")
                .Append(heroName)
                .Append("】");
                stringBuilder.Append(smsDialogVo.ContextText)
                .Append("\n\n");
            }
        }
示例#5
0
        public virtual void SetData(SmsDialogVo smsVo)
        {
            _data = smsVo;

            SetText(_data.ContextText);
        }