Example #1
0
        public void show(INameObj avatar, string msg)
        {
            if (!dItem.ContainsKey(avatar))
            {
                PlayerChatItem item;
                if (lPool.Count == 0)
                {
                    GameObject temp = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_chat_user");
                    GameObject go   = GameObject.Instantiate(temp) as GameObject;
                    go.transform.SetParent(playerChatLayer, false);
                    item = new PlayerChatItem(go.transform);
                }
                else
                {
                    item          = lPool[0];
                    item.visiable = true;
                    lPool.RemoveAt(0);
                }

                item.refresh(avatar, msg);
                lItem.Add(item);
                dItem[avatar] = item;

                if (avatar is ProfessionRole)
                {
                    item.refresShowChat(4);
                }
            }
            else
            {
                dItem[avatar].refresh(avatar, msg);
                dItem[avatar].refresShowChat(3);
            }
        }
Example #2
0
        public void hide(INameObj role)
        {
            if (role.roleName == PlayerModel.getInstance().name)
            {
                debug.Log("a");
            }
            if (!dItem.ContainsKey(role))
            {
                return;
            }
            PlayerChatItem item = dItem[role];

            item.clear();
            item.visiable = false;
            dItem.Remove(role);
            lItem.Remove(item);
            lPool.Add(item);
        }
Example #3
0
        public void hide(INameObj role)
        {
            bool flag = role.roleName == ModelBase <PlayerModel> .getInstance().name;

            if (flag)
            {
                debug.Log("a");
            }
            bool flag2 = !this.dItem.ContainsKey(role);

            if (!flag2)
            {
                PlayerChatItem playerChatItem = this.dItem[role];
                playerChatItem.clear();
                playerChatItem.visiable = false;
                this.dItem.Remove(role);
                this.lItem.Remove(playerChatItem);
                this.lPool.Add(playerChatItem);
            }
        }
Example #4
0
        public void show(INameObj avatar, string msg)
        {
            bool flag = !this.dItem.ContainsKey(avatar);

            if (flag)
            {
                bool           flag2 = this.lPool.Count == 0;
                PlayerChatItem playerChatItem;
                if (flag2)
                {
                    GameObject original   = Resources.Load("prefab/chat_user") as GameObject;
                    GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);
                    gameObject.transform.SetParent(this.playerChatLayer, false);
                    playerChatItem = new PlayerChatItem(gameObject.transform);
                }
                else
                {
                    playerChatItem          = this.lPool[0];
                    playerChatItem.visiable = true;
                    this.lPool.RemoveAt(0);
                }
                playerChatItem.refresh(avatar, msg);
                this.lItem.Add(playerChatItem);
                this.dItem[avatar] = playerChatItem;
                bool flag3 = avatar is ProfessionRole;
                if (flag3)
                {
                    playerChatItem.refresShowChat(3, false);
                }
            }
            else
            {
                this.dItem[avatar].refresh(avatar, msg);
                this.dItem[avatar].refresShowChat(3, false);
            }
        }