Example #1
0
    public void Init(GameProto.RoleData oData)
    {
        m_imgHead.gameObject.SetActive(true);
        LobbyTeamPlayer pLeader = TeamPlayerManager.Instance().GetPlayerBySlot(0);

        if (pLeader.m_qwPlayerId != PlayerData.Instance().proPlayerId)
        {
            m_buttonKick.gameObject.SetActive(false);
        }
        else
        {
            if (m_dwSlotId != 0)
            {
                m_buttonKick.gameObject.SetActive(false);
                //todo 先不踢玩家 如果要加这个功能 后面再处理
                m_buttonKick.gameObject.SetActive(true);
            }
            else
            {
                m_buttonKick.gameObject.SetActive(false);
            }
        }
        m_qwPlayerId    = oData.QwPlayerId;
        m_textName.text = oData.SzNickName;
        m_buttonInvite.gameObject.SetActive(false);
        StartCoroutine(H5Helper.SendGet(oData.SzAvatar, delegate(Texture2D tex)
        {
            m_imgHead.texture = tex;
        })
                       );
    }
Example #2
0
    void SlotClick()
    {
        if (m_qwPlayerId != 0)
        {
            return;
        }
        LobbyTeamPlayer pLeader = TeamPlayerManager.Instance().GetPlayerBySlot(0);

        if (pLeader.m_qwPlayerId != PlayerData.Instance().proPlayerId)
        {
            //其他人点就是换位置 后面可以加个其他模式
            LoginControler.Instance().ChangeSlot(m_dwSlotId);
        }
        else
        {
            //队长点 就是拉人
            LoginControler.Instance().OnlinePlayers();
        }
    }
Example #3
0
 public void PrepareSyncTeamInfo(Google.Protobuf.Collections.RepeatedField <GameProto.TeamRoleData> oInfo)
 {
     if (oInfo == null)
     {
         return;
     }
     for (int i = 0; i < m_arrRedPlayers.Length; ++i)
     {
         m_arrRedPlayers[i].PrepareInit(null);
     }
     for (int i = 0; i < m_arrBluePlayers.Length; ++i)
     {
         m_arrBluePlayers[i].PrepareInit(null);
     }
     for (int i = 0; i < oInfo.Count; i++)
     {
         LobbyTeamPlayer pPlayer = Instance().GetPlayerBySlot(oInfo[i].DwSlotId);
         pPlayer.PrepareInit(oInfo[i].RoleData);
     }
 }
Example #4
0
 public static void SyncTeamInfo(GameProto.LoginNotifyPlayerTeamInfo oInfo)
 {
     if (Instance() == null)
     {
         return;
     }
     for (int i = 0; i < Instance().m_arrRedPlayers.Length; ++i)
     {
         Instance().m_arrRedPlayers[i].Init();
     }
     for (int i = 0; i < Instance().m_arrBluePlayers.Length; ++i)
     {
         Instance().m_arrBluePlayers[i].Init();
     }
     for (int i = 0; i < oInfo.TeamRoleData.Count; i++)
     {
         LobbyTeamPlayer pPlayer = Instance().GetPlayerBySlot(oInfo.TeamRoleData[i].DwSlotId);
         pPlayer.Init(oInfo.TeamRoleData[i].RoleData);
     }
 }