/// <summary> /// 处理是否接受挑战支付界面按键事件. /// </summary> void HandleShiFouJieShouTiaoZhan_ZhiFuEnterBtEvent() { UnityLog("HandleShiFouJieShouTiaoZhan_ZhiFuEnterBtEvent -> m_BtState ==== " + m_BtState); switch (m_BtState) { case BtState.TongYi: { //清理最后一个结束游戏玩家的数据. SSGameDataCtrl.GetInstance().CleanLastOverPlayerData(); //激活该玩家. SSGameDataCtrl.GetInstance().SetActivePlayer(m_PlayerIndex, true); //删除等待对方同意PK. SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveDengDaiDuiFangTongYiPK(); //删除对方不敢应战,请继续等待. SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveDuiFangBuYingZhan_JiXuDengDai(); //同意购买挑战对方道具. SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].IsJieShouTiaoZhan = true; //删除购买挑战对方道具界面. SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameShiFouJieShouTiaoZhanPanel(); //删除挑战对方道具支付界面. SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameShiFouJieShouTiaoZhan_ZhiFuPanel(); if (SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].GameState == SSGameDataCtrl.PlayerGameState.YouXiQian) { //游戏前. //产生开始双人PK提示. SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnKaiShiShuangRenPK(); } else { //游戏中. //产生购买复活道具界面. SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameFuHuoDaoJuPanel(m_PlayerIndex); } break; } case BtState.JuJue: { //拒绝购买挑战对方道具. //删除挑战对方道具支付界面. SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameShiFouJieShouTiaoZhan_ZhiFuPanel(); //解锁挑战对方道具购买界面. SSGameDlgUI dlg = SSGameDataCtrl.GetInstance().m_SSUIRoot.m_SSGameDlgManage.FindGameDlgByType(GameDlgState.ShiFouJieShouTiaoZhan); if (dlg != null) { dlg.SetIsLockPanel(false); } break; } } }
/// <summary> /// 处理是否重新开始游戏支付界面按键事件(继续游戏支付界面). /// </summary> void HandleShiFouChongXinKaiShi_ZhiFuEnterBtEvent() { UnityLog("HandleShiFouChongXinKaiShi_ZhiFuEnterBtEvent -> m_BtState ==== " + m_BtState); switch (m_BtState) { case BtState.TongYi: { //同意购买重新开始游戏道具(继续游戏界面). //删除购买重新开始游戏道具界面(继续游戏界面). SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameShiFouChongXinKaiShiPanel(); //删除重新开始游戏道具支付界面(继续游戏支付界面). SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameShiFouChongXinKaiShi_ZhiFuPanel(); //激活该玩家. SSGameDataCtrl.GetInstance().SetActivePlayer(m_PlayerIndex, true); //恢复玩家的游戏数据. SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].Score = SSGameDataCtrl.GetInstance().m_LastOverPlayerData.Score; SSGameDataCtrl.GetInstance().m_PlayerData[(int)m_PlayerIndex].IsTongYiJiXuGame = true; //SSGameDataCtrl.GetInstance().m_BallSpawnArray[(int)m_PlayerIndex].IndexCreatBallJieDuan = SSGameDataCtrl.GetInstance().m_LastOverPlayerData.IndexCreatBallJieDuan; //产生复活道具界面. SSGameDataCtrl.GetInstance().m_SSUIRoot.SpawnGameFuHuoDaoJuPanel(m_PlayerIndex); //删除等待对方同意PK. SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveDengDaiDuiFangTongYiPK(); break; } case BtState.JuJue: { //拒绝购买重新开始游戏道具(继续游戏). //删除重新开始游戏道具支付界面(继续游戏支付界面). SSGameDataCtrl.GetInstance().m_SSUIRoot.RemoveGameShiFouChongXinKaiShi_ZhiFuPanel(); //解锁重新开始游戏(继续游戏)道具购买界面. SSGameDlgUI dlg = SSGameDataCtrl.GetInstance().m_SSUIRoot.m_SSGameDlgManage.FindGameDlgByType(GameDlgState.ShiFouChongXinKaiShi); if (dlg != null) { dlg.SetIsLockPanel(false); } break; } } }