Example #1
0
    /// <summary>
    /// 玩家进入房间
    /// </summary>
    /// <param name="responseReturnCode">0代表进入房间成功,1代表全部人进入房间</param>
    /// <param name="playerID"></param>
    private void OnEnter(short responseReturnCode, int playerID)
    {
        switch (responseReturnCode)
        {
        case 0:
            //有玩家进入房间
            foreach (SelectModel redTeamSelectModel in _redTeamSelectModels)
            {
                if (redTeamSelectModel.PlayerID == playerID)
                {
                    redTeamSelectModel.IsEnter = true;
                    OnGetInfo();
                    return;
                }
            }
            foreach (SelectModel blueTeamSelectModel in _blueTeamSelectModels)
            {
                if (blueTeamSelectModel.PlayerID == playerID)
                {
                    blueTeamSelectModel.IsEnter = true;
                    OnGetInfo();
                    return;
                }
            }
            break;

        case 1:
            //全部玩家进入房间
            //初始化玩家拥有的英雄
            selectView.InitSelectHeroPanel(GameData.Player.HeroID);
            break;
        }
    }