// 刷新状态,战斗开始必然发送 public void psstRetRefreshBattleStateUserCmd(stRetRefreshBattleStateUserCmd msg) { // ChallengeState.CHALLENGE_STATE_BATTLE 状态或者是刚开始,或者是中间掉线,然后重新上线 if (Ctx.m_instance.m_dataPlayer.m_dzData.m_state == (int)ChallengeState.CHALLENGE_STATE_BATTLE) { m_sceneDZData.m_roundMgr.bStartRound = true; // 停止各种倒计时 m_sceneDZData.m_roundMgr.stopTimer(); if (Ctx.m_instance.m_dataPlayer.m_dzData.bSelfSide()) { // 显示自己回合 m_sceneDZData.m_cardNpcMgr.m_selfRoundTip.playEffect(); m_sceneDZData.m_cardNpcMgr.m_roundBtn.myTurn(); // 开始定时器 m_sceneDZData.m_roundMgr.startDZTimer(); } else { m_sceneDZData.m_cardNpcMgr.m_roundBtn.enemyTurn(); } if (Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)EnDZPlayer.ePlayerSelf].bHaveStartCard()) // 如果自己有初始化的牌 { m_sceneDZData.m_placeHolderGo.m_startGO.SetActive(false); m_sceneDZData.m_sceneDZAreaArr[(int)EnDZPlayer.ePlayerSelf].inSceneCardList.startCardMoveTo(); // 一定初始化卡牌到卡牌列表 } m_sceneDZData.m_gameRunState.enterState(GameRunState.STARTDZ); // 进入对战状态 } }
// 刷新战斗状态 protected void psstRetRefreshBattleStateUserCmd(ByteBuffer bu) { stRetRefreshBattleStateUserCmd cmd = new stRetRefreshBattleStateUserCmd(); cmd.derialize(bu); Ctx.m_instance.m_dataPlayer.m_dzData.m_state = cmd.state; UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ); if (uiDZ != null && uiDZ.isVisible()) { uiDZ.psstRetRefreshBattleStateUserCmd(cmd); } }