Exemplo n.º 1
0
        //创建聊天记录
        private void CreateChatMsg(SMsgChat_SC sMsgChat_SC)
        {
            if (m_myActorID == 0)
            {
                m_myActorID = PlayerManager.Instance.FindHeroDataModel().ActorID;
            }

            int talkerID = 0;

            if (sMsgChat_SC.senderActorID == m_myActorID)
            {
                talkerID = sMsgChat_SC.accepterActorID;
            }
            else
            {
                talkerID = sMsgChat_SC.senderActorID;
            }

            //调出窗口
            var chatWindowClass = this.RecallWindow(talkerID, sMsgChat_SC.SenderName);

            if (this.m_CurActorID != talkerID)
            {
                //闪烁提示
                //chatWindowClass.TalkerItem.StartFlashing();
            }
            //添加聊天信息
            string chatContent = "";
            bool   isMyChat    = sMsgChat_SC.senderActorID == m_myActorID;

            chatContent = ChatPanelUIManager.ColoringChannel("[私人]") + ChatPanelUIManager.ColoringName(sMsgChat_SC.SenderName + " : ") + sMsgChat_SC.Chat;
            chatWindowClass.PrivateChatWindowItem.CreateChatItem(talkerID, isMyChat, chatContent);
        }
Exemplo n.º 2
0
        //创建之前聊天记录
        private void CreateChatMsg(int talkerID, List <SMsgChat_SC> chatList)
        {
            var chatWindowClass = this.RecallWindow(talkerID, chatList.First().SenderName);

            chatList.ApplyAllItem(p =>
            {
                string chatContent = "";
                bool isMyChat      = p.senderActorID == m_myActorID;
                chatContent        = ChatPanelUIManager.ColoringChannel("[私人]") + ChatPanelUIManager.ColoringName(p.SenderName + " : ") + p.Chat;
                chatWindowClass.PrivateChatWindowItem.CreateChatItem(talkerID, isMyChat, chatContent);
            });
        }
Exemplo n.º 3
0
        public void CreateChat(SMsgChat_SC sMsgChat_SC)
        {
            string chatContent = "";

            chatContent = ChatPanelUIManager.ColoringChannel("[房间]") + ChatPanelUIManager.ColoringName(sMsgChat_SC.SenderName + " : ") + sMsgChat_SC.Chat;
            GameObject chat = (GameObject)Instantiate(ChatLabelItemPrefab.gameObject);

            chat.transform.parent        = Table.transform;
            chat.transform.localScale    = Vector3.one;
            chat.transform.localPosition = Vector3.zero;
            var  chatControl = chat.GetComponent <ChatLabelItem>();
            bool isMyChat    = sMsgChat_SC.senderActorID == PlayerManager.Instance.FindHeroDataModel().ActorID;

            chatControl.Init(isMyChat, chatContent);

            Table.Reposition();
            StartCoroutine("SetDragAmount");
        }