コード例 #1
0
    /// <summary>
    /// 同步玩家亮牌
    /// </summary>
    /// <param name="data"></param>
    private IEnumerator OnPlayerLiangCard(TenOnPlayerOptResult data)
    {
        bool isSelf = (data.seatId == TenModel.Inst.mMySeatId);

        if (isSelf)
        {
            TenModel.Inst.mLookCard = true;
            mSelfPlayer.HideLiangCuoState();
            if (BaseView.childrenWidgetDic.ContainsKey(typeof(TenCuoCardWidget).Name))
            {
                BaseViewWidget.CloseWidget <TenCuoCardWidget>();
            }
        }


        TenPlayerUI player = null;

        if (TryGetPlayer(data.seatId, out player))
        {
            if (player.GetTurnState())
            {
                yield break;
            }
            player.TurnCards(data.cards);
            yield return(new WaitForSeconds(0.7f));

            player.SeparateCards(data.cardsType.order);

            player.SetCardType(true, data.cardsType.point, data.cardsType.ratio, isSelf);
        }
    }
コード例 #2
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);
    }
コード例 #3
0
    /// <summary>
    /// 创建俱乐部
    /// </summary>
    /// <param name="name"></param>
    public void SendCreateClub(string name)
    {
        SendCreateClubReq req = new SendCreateClubReq();

        req.name = name;
        NetProcess.SendRequest <SendCreateClubReq>(req, ProtoIdMap.CMD_SendCreateClub, (msg) => {
            SendCreateClubAck ack = msg.Read <SendCreateClubAck>();
            if (ack.code == 1)
            {
                Global.Inst.GetController <CommonTipsController>().ShowTips("创建成功!");
                BaseViewWidget.CloseWidget <CreateClubWidget>();
            }
            else
            {
                GameUtils.ShowErrorTips(ack.code);
            }
        });
    }
コード例 #4
0
    /// <summary>
    /// 清理桌面
    /// </summary>
    public void CleanDesk()
    {
        List <int> list = new List <int>();

        list.AddRange(mPlayerDic.Keys);
        for (int i = 0; i < list.Count; i++)
        {
            mPlayerDic[list[i]].CleanHandCards();
            mPlayerDic[list[i]].SetQiangZhuangResult(false, 0);
            mPlayerDic[list[i]].SetCardType(false, 0, 0);
            mPlayerDic[list[i]].SetZhuangState(false);
            mPlayerDic[list[i]].UpdateCathecticCoin("");
        }

        BaseViewWidget.CloseWidget <NiuNiuCuoCardWidget>();
        mSelfPlayer.CloseCuoCardWidget();

        mRandomZhuangDown = true;
        mCastDown         = true;
    }
コード例 #5
0
 public void CloseCuoCardWidget()
 {
     BaseViewWidget.CloseWidget <NiuNiuCuoCardWidget>();
     mCuoCardWidget = null;
 }