Example #1
0
    /// <summary>
    /// 有玩家离开
    /// </summary>
    /// <param name="seatId"></param>
    public void NetOnPlayerLeave(int seatId)
    {
        TenPlayerUI player = null;

        GameObject widget = null;

        if (BaseView.childrenWidgetDic.TryGetValue(typeof(GameUserInfoWidget).Name, out widget))
        {
            if (widget != null)
            {
                GameUserInfoWidget infoWidget = widget.GetComponent <GameUserInfoWidget>();
                if (infoWidget != null)
                {
                    if (infoWidget.GetSeatId() == seatId)
                    {
                        BaseViewWidget.CloseWidget <GameUserInfoWidget>();
                    }
                }
            }
        }

        if (TryGetPlayer(seatId, out player))
        {
            player.CleanHandCards();
            player.CleanPlayer();
        }

        mPlayerDic.Remove(seatId);
    }