/// <summary> /// 自己得到操作 /// </summary> /// <param name="data"></param> /// <returns></returns> private IEnumerator IEOnSelfOpt(NNOnSelfOpt data) { yield return(new WaitUntil(() => { return mRandomZhuangDown == true; })); yield return(new WaitUntil(() => { return mCastDown == true; })); switch ((eNNOpt)data.ins) { case eNNOpt.Nil: //同步房间状态 switch ((eNNGameState)data.gameState) { case eNNGameState.LookCard: ShowLastTime("亮牌倒计时", data.lastTime - 2); break; case eNNGameState.QiangZhuang: ShowLastTime("抢庄倒计时", data.lastTime - 2); break; case eNNGameState.Ready: ShowLastTime("准备倒计时", data.lastTime - 2); break; case eNNGameState.XiaZhu: ShowLastTime("下注倒计时", data.lastTime - 2); break; } break; case eNNOpt.QZ: //抢庄 ShowLastTime("抢庄倒计时", data.lastTime - 2); mSelfPlayer.SetBetBtnItemState(true); mSelfPlayer.InitOptItemList <int>(data.qzListValue); mSelfPlayer.ShowBetBtnList(data.canQzList); break; case eNNOpt.XZ: //下注 ShowLastTime("下注倒计时", data.lastTime - 2); mSelfPlayer.SetBetBtnItemState(true); mSelfPlayer.InitOptItemList <float>(data.xzListValue); mSelfPlayer.ShowBetBtnList(data.canXzList); CleanQzStateBut(NiuniuModel.Inst.mZhuangSeatId); break; case eNNOpt.LP: //亮牌 ShowLastTime("亮牌倒计时", data.lastTime - 2); mSelfPlayer.SetLiangCardBtnState(true); mSelfPlayer.SetCuoBtnState(true); break; } }
/// <summary> /// 自己获得操作指令 /// </summary> /// <param name="msg"></param> private void NetOnSelfOpt(MessageData msg) { NNOnSelfOpt ack = msg.Read <NNOnSelfOpt>(); if (ack.qzListValue != null) { NiuniuModel.Inst.mQzListValue = ack.qzListValue; } if (ack.xzListValue != null) { NiuniuModel.Inst.mXzListValue = ack.xzListValue; } NiuniuModel.Inst.mGameState = (eNNGameState)ack.gameState; if (ack.gameSeatIdList != null) { NiuniuModel.Inst.mGameedSeatIdList = ack.gameSeatIdList; if (ack.gameSeatIdList.Contains(NiuniuModel.Inst.mMySeatId)) { NiuniuModel.Inst.mGameed = true; } } mView.NetOnSelfOpt(ack); }
/// <summary> /// 自己得到操作指令 /// </summary> /// <param name="data"></param> public void NetOnSelfOpt(NNOnSelfOpt data) { StartCoroutine(IEOnSelfOpt(data)); }