Exemplo n.º 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);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 玩家操作结果
    /// </summary>
    /// <param name="data"></param>
    public void NetOnPlayerOptResult(TenOnPlayerOptResult data)
    {
        switch ((eTenOpt)data.ins)
        {
        case eTenOpt.QZ:    //抢庄
            OnPlayerQiangZhuang(data);
            break;

        case eTenOpt.XZ:    //下注
            OnPlayerXiaZhu(data);
            break;

        case eTenOpt.LP:    //亮牌
            StartCoroutine(OnPlayerLiangCard(data));
            break;

        case eTenOpt.YP:
            Debug.Log("要牌啦");
            StartCoroutine(IEOtherCastCard(data.seatId));
            break;

        case eTenOpt.TP:
            Debug.Log("停牌啦");
            mSelfPlayer.SetLiangCardBtnState(false);
            mSelfPlayer.SetCuoBtnState(false);
            break;
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// 同步玩家抢庄
    /// </summary>
    /// <param name="data"></param>
    private void OnPlayerQiangZhuang(TenOnPlayerOptResult data)
    {
        if (data.seatId == TenModel.Inst.mMySeatId)
        {
            mSelfPlayer.SetBetBtnItemState(false);
        }

        TenPlayerUI player = null;

        if (TryGetPlayer(data.seatId, out player))
        {
            player.SetQiangZhuangResult(true, data.qzValue);
        }
    }
Exemplo n.º 4
0
    /// <summary>
    /// 同步玩家下注
    /// </summary>
    /// <param name="data"></param>
    private void OnPlayerXiaZhu(TenOnPlayerOptResult data)
    {
        if (data.seatId == TenModel.Inst.mMySeatId)
        {
            mSelfPlayer.SetBetBtnItemState(false);
        }
        TenPlayerUI player = null;

        if (mNiuniuCoinFlyWidget == null)
        {
            mNiuniuCoinFlyWidget = BaseView.GetWidget <TenCoinFlyWidget>(AssetsPathDic.TenCoinFlyWidget, transform);
        }
        if (TryGetPlayer(data.seatId, out player))
        {
            player.UpdateCathecticCoin(data.xzValue + "");
            mNiuniuCoinFlyWidget.SetCoinFly(player.GetBaseInfoPos(), player.GetChePosition(), 1, 0.3f);
        }
    }
Exemplo n.º 5
0
    /// <summary>
    /// 玩家操作结果
    /// </summary>
    /// <param name="msg"></param>
    private void NetOnPlayerOptResult(MessageData msg)
    {
        TenOnPlayerOptResult ack = msg.Read <TenOnPlayerOptResult>();

        mView.NetOnPlayerOptResult(ack);
    }