예제 #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);
        }