// Use this for initialization void Start() { switch (PlayerSt) { case PlayerEnum.PlayerOne: _InstanceOne = this; XKGlobalData.SetCoinPlayerOne(XKGlobalData.CoinPlayerOne); InputEventCtrl.GetInstance().ClickStartBtOneEvent += ClickStartBtOneEvent; break; case PlayerEnum.PlayerTwo: _InstanceTwo = this; XKGlobalData.SetCoinPlayerTwo(XKGlobalData.CoinPlayerTwo); InputEventCtrl.GetInstance().ClickStartBtTwoEvent += ClickStartBtTwoEvent; break; } SetGameNeedCoin(XKGlobalData.GameNeedCoin); SetActiveFreeMode(XKGlobalData.IsFreeMode); InsertCoinObj.SetActive(false); StartBtObj.SetActive(false); switch (GameTypeCtrl.AppTypeStatic) { case AppGameType.LianJiServer: gameObject.SetActive(false); break; } }
// Use this for initialization void Start() { switch (PlayerSt) { case PlayerEnum.PlayerOne: _InstanceOne = this; XKGlobalData.SetCoinPlayerOne(XKGlobalData.CoinPlayerOne); InputEventCtrl.GetInstance().ClickStartBtOneEvent += ClickStartBtOneEvent; break; case PlayerEnum.PlayerTwo: _InstanceTwo = this; XKGlobalData.SetCoinPlayerTwo(XKGlobalData.CoinPlayerTwo); InputEventCtrl.GetInstance().ClickStartBtTwoEvent += ClickStartBtTwoEvent; break; case PlayerEnum.PlayerThree: _InstanceThree = this; XKGlobalData.SetCoinPlayerThree(XKGlobalData.CoinPlayerThree); InputEventCtrl.GetInstance().ClickStartBtThreeEvent += ClickStartBtThreeEvent; break; case PlayerEnum.PlayerFour: _InstanceFour = this; XKGlobalData.SetCoinPlayerFour(XKGlobalData.CoinPlayerFour); //InputEventCtrl.GetInstance().ClickStartBtFourEvent += ClickStartBtFourEvent; break; } SetGameNeedCoin(XKGlobalData.GameNeedCoin); SetActiveFreeMode(XKGlobalData.IsFreeMode); InsertCoinObj.SetActive(false); StartBtObj.SetActive(false); if (ZhunBeiZhanDou != null) { ZhunBeiZhanDou.SetActive(false); } switch (GameTypeCtrl.AppTypeStatic) { case AppGameType.LianJiServer: gameObject.SetActive(false); break; } SetActiveMianFeiTiYanUI(false); }
// Use this for initialization void Start() { TimeValNet = Time.realtimeSinceStartup; switch (PlayerSt) { case PlayerEnum.PlayerOne: _InstanceOne = this; if (GameMovieCtrl.IsNoDisplayP1) { transform.localPosition = new Vector3(0f, -18000f, 0f); } XKGlobalData.SetCoinPlayerOne(XKGlobalData.CoinPlayerOne); InputEventCtrl.GetInstance().ClickStartBtOneEvent += ClickStartBtOneEvent; break; case PlayerEnum.PlayerTwo: _InstanceTwo = this; if (GameMovieCtrl.IsNoDisplayP1) { Vector3 posLoc = transform.localPosition; posLoc.x = 0f; transform.localPosition = posLoc; } XKGlobalData.SetCoinPlayerTwo(XKGlobalData.CoinPlayerTwo); InputEventCtrl.GetInstance().ClickStartBtTwoEvent += ClickStartBtTwoEvent; break; } SetGameNeedCoin(XKGlobalData.GameNeedCoin); SetActiveFreeMode(XKGlobalData.IsFreeMode); InsertCoinObj.SetActive(false); StartBtObj.SetActive(false); // switch(GameTypeCtrl.AppTypeStatic) { // case AppGameType.LianJiServer: // gameObject.SetActive(false); // break; // } }
//byte[] TestYKQDirState = new byte[4]; //byte[] TestYKQDirCount = new byte[4]; void Update() { //#if !UNITY_EDITOR // if (SetEnterBtSt == ButtonState.DOWN && Time.time - TimeSetEnterMoveBt > 2f) { // HardwareCheckCtrl.OnRestartGame(); // } //#endif if (pcvr.bIsHardWare && !TestTanKCom.IsTestTankCom && !pcvr.IsTestInput) { return; } #if UNITY_ANDROID if (Input.GetKeyDown(KeyCode.G) || Input.GetKeyDown(KeyCode.K)) { //遥控器的确定键消息. ClickTVYaoKongEnterBt(ButtonState.DOWN); ClickSetMoveBt(ButtonState.DOWN); //test } if (Input.GetKeyUp(KeyCode.G) || Input.GetKeyUp(KeyCode.K)) { //遥控器的确定键消息. ClickTVYaoKongEnterBt(ButtonState.UP); ClickSetMoveBt(ButtonState.UP); //test } #endif //(KeyCode)10 -> acbox虚拟机的遥控器确定键消息. if (Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCodeTV.PadEnter01) || Input.GetKeyDown(KeyCodeTV.PadEnter02) || Input.GetKeyDown(KeyCode.JoystickButton0)) { //遥控器的确定键消息. ClickTVYaoKongEnterBt(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.KeypadEnter) || Input.GetKeyUp(KeyCode.Return) || Input.GetKeyUp(KeyCodeTV.PadEnter01) || Input.GetKeyUp(KeyCodeTV.PadEnter02) || Input.GetKeyUp(KeyCode.JoystickButton0)) { //遥控器的确定键消息. ClickTVYaoKongEnterBt(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Escape)) { //接收遥控器的返回键/键盘上的Esc按键信息. ClickTVYaoKongExitBt(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.Escape)) { //接收遥控器的返回键/键盘上的Esc按键信息. ClickTVYaoKongExitBt(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.Keypad4)) { //接收遥控器/键盘上的向左按键信息. ClickTVYaoKongLeftBt(ButtonState.DOWN); //TestYKQDirState[0] = 1; //TestYKQDirCount[0]++; } if (Input.GetKeyUp(KeyCode.LeftArrow) || Input.GetKeyUp(KeyCode.Keypad4)) { //接收遥控器/键盘上的向左按键信息. ClickTVYaoKongLeftBt(ButtonState.UP); //TestYKQDirState[0] = 0; //TestYKQDirCount[0]++; } if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.Keypad6)) { //接收遥控器/键盘上的向右按键信息. ClickTVYaoKongRightBt(ButtonState.DOWN); //TestYKQDirState[1] = 1; //TestYKQDirCount[1]++; } if (Input.GetKeyUp(KeyCode.RightArrow) || Input.GetKeyUp(KeyCode.Keypad6)) { //接收遥控器/键盘上的向右按键信息. ClickTVYaoKongRightBt(ButtonState.UP); //TestYKQDirState[1] = 0; //TestYKQDirCount[1]++; } if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.Keypad2)) { //接收遥控器/键盘上的向上按键信息. ClickTVYaoKongUpBt(ButtonState.DOWN); //TestYKQDirState[2] = 1; //TestYKQDirCount[2]++; } if (Input.GetKeyUp(KeyCode.UpArrow) || Input.GetKeyUp(KeyCode.Keypad2)) { //接收遥控器/键盘上的向上按键信息. ClickTVYaoKongUpBt(ButtonState.UP); //TestYKQDirState[2] = 0; //TestYKQDirCount[2]++; } if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.Keypad8)) { //接收遥控器/键盘上的向下按键信息. ClickTVYaoKongDownBt(ButtonState.DOWN); //TestYKQDirState[3] = 1; //TestYKQDirCount[3]++; } if (Input.GetKeyUp(KeyCode.DownArrow) || Input.GetKeyUp(KeyCode.Keypad8)) { //接收遥控器/键盘上的向下按键信息. ClickTVYaoKongDownBt(ButtonState.UP); //TestYKQDirState[3] = 0; //TestYKQDirCount[3]++; } if (pcvr.IsHongDDShouBing) { return; } if (Input.GetKeyUp(KeyCode.T)) { int coinVal = XKGlobalData.CoinPlayerOne + 1; XKGlobalData.SetCoinPlayerOne(coinVal); } if (Input.GetKeyUp(KeyCode.Y)) { int coinVal = XKGlobalData.CoinPlayerTwo + 1; XKGlobalData.SetCoinPlayerTwo(coinVal); } if (Input.GetKeyUp(KeyCode.U)) { if (XKGlobalData.GameVersionPlayer == 0) { int coinVal = XKGlobalData.CoinPlayerThree + 1; XKGlobalData.SetCoinPlayerThree(coinVal); } } if (Input.GetKeyUp(KeyCode.I)) { if (XKGlobalData.GameVersionPlayer == 0) { int coinVal = XKGlobalData.CoinPlayerFour + 1; XKGlobalData.SetCoinPlayerFour(coinVal); } } //StartBt PlayerOne if (Input.GetKeyUp(KeyCode.G)) { ClickStartBtOne(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.G)) { ClickStartBtOne(ButtonState.DOWN); } //StartBt PlayerTwo if (Input.GetKeyUp(KeyCode.H)) { ClickStartBtTwo(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.H)) { ClickStartBtTwo(ButtonState.DOWN); } //StartBt PlayerThree if (Input.GetKeyUp(KeyCode.J)) { ClickStartBtThree(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.J)) { ClickStartBtThree(ButtonState.DOWN); } //StartBt PlayerFour if (Input.GetKeyUp(KeyCode.K)) { ClickStartBtFour(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.K)) { ClickStartBtFour(ButtonState.DOWN); } //player_1. if (Input.GetKeyDown(KeyCode.A)) { ClickFangXiangLBtP1(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.A)) { ClickFangXiangLBtP1(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.D)) { ClickFangXiangRBtP1(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.D)) { ClickFangXiangRBtP1(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.W)) { ClickFangXiangUBtP1(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.W)) { ClickFangXiangUBtP1(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.S)) { ClickFangXiangDBtP1(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.S)) { ClickFangXiangDBtP1(ButtonState.UP); } //player_2. if (!TestTanKCom.IsTestTankCom) { if (Input.GetKeyDown(KeyCode.F)) { ClickFangXiangLBtP2(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.F)) { ClickFangXiangLBtP2(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.H)) { ClickFangXiangRBtP2(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.H)) { ClickFangXiangRBtP2(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.T)) { ClickFangXiangUBtP2(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.T)) { ClickFangXiangUBtP2(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.G)) { ClickFangXiangDBtP2(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.G)) { ClickFangXiangDBtP2(ButtonState.UP); } } else { PlayerYM[1] = TestTanKCom.YouMenStateP2; PlayerFX[1] = TestTanKCom.FangXiangStateP2; } //player_3. if (!TestTanKCom.IsTestTankCom) { if (Input.GetKeyDown(KeyCode.J)) { ClickFangXiangLBtP3(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.J)) { ClickFangXiangLBtP3(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.L)) { ClickFangXiangRBtP3(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.L)) { ClickFangXiangRBtP3(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.I)) { ClickFangXiangUBtP3(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.I)) { ClickFangXiangUBtP3(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.K)) { ClickFangXiangDBtP3(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.K)) { ClickFangXiangDBtP3(ButtonState.UP); } } else { PlayerFX[2] = TestTanKCom.FangXiangStateP3; PlayerYM[2] = TestTanKCom.YouMenStateP3; } //player_4. if (Input.GetKeyDown(KeyCode.LeftArrow)) { ClickFangXiangLBtP4(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.LeftArrow)) { ClickFangXiangLBtP4(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.RightArrow)) { ClickFangXiangRBtP4(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.RightArrow)) { ClickFangXiangRBtP4(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.UpArrow)) { ClickFangXiangUBtP4(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.UpArrow)) { ClickFangXiangUBtP4(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.DownArrow)) { ClickFangXiangDBtP4(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.DownArrow)) { ClickFangXiangDBtP4(ButtonState.UP); } //setPanel enter button if (Input.GetKeyUp(KeyCode.F4)) { ClickSetEnterBt(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F4)) { ClickSetEnterBt(ButtonState.DOWN); } //setPanel move button if (Input.GetKeyUp(KeyCode.F5)) { ClickSetMoveBt(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F5)) { ClickSetMoveBt(ButtonState.DOWN); } //Fire button if (Input.GetKeyUp(KeyCode.Mouse0)) { IsClickFireBtOneDown = false; IsClickFireBtTwoDown = false; IsClickFireBtThreeDown = false; IsClickFireBtFourDown = false; ClickFireBtOne(ButtonState.UP); if (!TestTanKCom.IsTestTankCom) { ClickFireBtTwo(ButtonState.UP); ClickFireBtThree(ButtonState.UP); } ClickFireBtFour(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse0)) { IsClickFireBtOneDown = true; IsClickFireBtTwoDown = true; IsClickFireBtThreeDown = true; IsClickFireBtFourDown = true; ClickFireBtOne(ButtonState.DOWN); if (!TestTanKCom.IsTestTankCom) { ClickFireBtTwo(ButtonState.DOWN); ClickFireBtThree(ButtonState.DOWN); } ClickFireBtFour(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.Mouse1)) { ClickDaoDanBtOne(ButtonState.UP); if (!TestTanKCom.IsTestTankCom) { ClickDaoDanBtTwo(ButtonState.UP); ClickDaoDanBtThree(ButtonState.UP); } ClickDaoDanBtFour(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse1)) { ClickDaoDanBtOne(ButtonState.DOWN); if (!TestTanKCom.IsTestTankCom) { ClickDaoDanBtTwo(ButtonState.DOWN); ClickDaoDanBtThree(ButtonState.DOWN); } ClickDaoDanBtFour(ButtonState.DOWN); } if (Input.GetKeyDown(KeyCode.C)) { ClickStopDongGanBtOne(ButtonState.DOWN); ClickStopDongGanBtTwo(ButtonState.DOWN); ClickStopDongGanBtThree(ButtonState.DOWN); ClickStopDongGanBtFour(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.C)) { ClickStopDongGanBtOne(ButtonState.UP); ClickStopDongGanBtTwo(ButtonState.UP); ClickStopDongGanBtThree(ButtonState.UP); ClickStopDongGanBtFour(ButtonState.UP); } }
void Update() { #if !USE_PC_INPUT_TEST if (pcvr.bIsHardWare) { return; } #else IsUsePcInputTest = true; #endif if (Input.GetKeyUp(KeyCode.T)) { int coinVal = XKGlobalData.CoinPlayerOne + 1; XKGlobalData.SetCoinPlayerOne(coinVal); } if (Input.GetKeyUp(KeyCode.Y)) { int coinVal = XKGlobalData.CoinPlayerTwo + 1; XKGlobalData.SetCoinPlayerTwo(coinVal); } if (Input.GetKeyUp(KeyCode.U)) { if (XKGlobalData.GameVersionPlayer == 0) { int coinVal = XKGlobalData.CoinPlayerThree + 1; XKGlobalData.SetCoinPlayerThree(coinVal); } } //if (Input.GetKeyUp(KeyCode.I)) { // if (XKGlobalData.GameVersionPlayer == 0) { // int coinVal = XKGlobalData.CoinPlayerFour + 1; // XKGlobalData.SetCoinPlayerFour(coinVal); // } //} //StartBt PlayerOne if (Input.GetKeyUp(KeyCode.G)) { ClickStartBtOne(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.G)) { ClickStartBtOne(pcvr.ButtonState.DOWN); } //StartBt PlayerTwo if (Input.GetKeyUp(KeyCode.H)) { ClickStartBtTwo(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.H)) { ClickStartBtTwo(pcvr.ButtonState.DOWN); } //StartBt PlayerThree if (Input.GetKeyUp(KeyCode.J)) { ClickStartBtThree(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.J)) { ClickStartBtThree(pcvr.ButtonState.DOWN); } //StartBt PlayerFour //if (Input.GetKeyUp(KeyCode.K)) { // ClickStartBtFour( pcvr.ButtonState.UP ); //} //if (Input.GetKeyDown(KeyCode.K)) { // ClickStartBtFour( pcvr.ButtonState.DOWN ); //} if (XkGameCtrl.GetInstance() != null && XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer) { //没有玩家激活游戏. } else { //player_1. if (Input.GetKeyDown(KeyCode.A)) { ClickFangXiangLBtP1(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.A)) { ClickFangXiangLBtP1(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.D)) { ClickFangXiangRBtP1(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.D)) { ClickFangXiangRBtP1(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.W)) { ClickFangXiangUBtP1(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.W)) { ClickFangXiangUBtP1(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.S)) { ClickFangXiangDBtP1(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.S)) { ClickFangXiangDBtP1(pcvr.ButtonState.UP); } //player_2. if (Input.GetKeyDown(KeyCode.F)) { ClickFangXiangLBtP2(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.F)) { ClickFangXiangLBtP2(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.H)) { ClickFangXiangRBtP2(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.H)) { ClickFangXiangRBtP2(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.T)) { ClickFangXiangUBtP2(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.T)) { ClickFangXiangUBtP2(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.G)) { ClickFangXiangDBtP2(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.G)) { ClickFangXiangDBtP2(pcvr.ButtonState.UP); } //player_3. if (Input.GetKeyDown(KeyCode.J)) { ClickFangXiangLBtP3(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.J)) { ClickFangXiangLBtP3(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.L)) { ClickFangXiangRBtP3(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.L)) { ClickFangXiangRBtP3(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.I)) { ClickFangXiangUBtP3(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.I)) { ClickFangXiangUBtP3(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.K)) { ClickFangXiangDBtP3(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.K)) { ClickFangXiangDBtP3(pcvr.ButtonState.UP); } //player_4. if (Input.GetKeyDown(KeyCode.LeftArrow)) { ClickFangXiangLBtP4(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.LeftArrow)) { ClickFangXiangLBtP4(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.RightArrow)) { ClickFangXiangRBtP4(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.RightArrow)) { ClickFangXiangRBtP4(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.UpArrow)) { ClickFangXiangUBtP4(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.UpArrow)) { ClickFangXiangUBtP4(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.DownArrow)) { ClickFangXiangDBtP4(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.DownArrow)) { ClickFangXiangDBtP4(pcvr.ButtonState.UP); } } //setPanel enter button if (Input.GetKeyUp(KeyCode.F4)) { ClickSetEnterBt(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F4)) { ClickSetEnterBt(pcvr.ButtonState.DOWN); } //setPanel move button if (Input.GetKeyUp(KeyCode.F5)) { ClickSetMoveBt(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F5)) { ClickSetMoveBt(pcvr.ButtonState.DOWN); } //Fire button if (Input.GetKeyUp(KeyCode.Mouse0)) { ClickFireBtOne(pcvr.ButtonState.UP); ClickFireBtTwo(pcvr.ButtonState.UP); ClickFireBtThree(pcvr.ButtonState.UP); ClickFireBtFour(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse0)) { ClickFireBtOne(pcvr.ButtonState.DOWN); ClickFireBtTwo(pcvr.ButtonState.DOWN); ClickFireBtThree(pcvr.ButtonState.DOWN); ClickFireBtFour(pcvr.ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.Mouse1)) { ClickDaoDanBtOne(pcvr.ButtonState.UP); ClickDaoDanBtTwo(pcvr.ButtonState.UP); ClickDaoDanBtThree(pcvr.ButtonState.UP); ClickDaoDanBtFour(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse1)) { ClickDaoDanBtOne(pcvr.ButtonState.DOWN); ClickDaoDanBtTwo(pcvr.ButtonState.DOWN); ClickDaoDanBtThree(pcvr.ButtonState.DOWN); ClickDaoDanBtFour(pcvr.ButtonState.DOWN); } //test //if (Input.GetKeyDown(KeyCode.P)) //{ // PcvrComInputEvent.GetInstance().ClickPcvrBt07(pcvr.ButtonState.DOWN); //} //if (Input.GetKeyUp(KeyCode.P)) //{ // PcvrComInputEvent.GetInstance().ClickPcvrBt07(pcvr.ButtonState.UP); //} //test }
// float TimeSetEnterMoveBt; // ButtonState SetEnterBtSt = ButtonState.UP; void Update() { // if (SetEnterBtSt == ButtonState.DOWN && Time.time - TimeSetEnterMoveBt > 2f) { // HardwareCheckCtrl.OnRestartGame(); // } if (pcvr.bIsHardWare) { return; } if (Input.GetKeyUp(KeyCode.T)) { int coinVal = XKGlobalData.CoinPlayerOne + 1; XKGlobalData.SetCoinPlayerOne(coinVal); } if (Input.GetKeyUp(KeyCode.I)) { int coinVal = XKGlobalData.CoinPlayerTwo + 1; XKGlobalData.SetCoinPlayerTwo(coinVal); } if (Input.GetKeyUp(KeyCode.W)) { ClickStopMovePlayerBt(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.W)) { ClickStopMovePlayerBt(ButtonState.DOWN); } //StartBt PlayerOne if (Input.GetKeyUp(KeyCode.G)) { ClickStartBtOne(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.G)) { ClickStartBtOne(ButtonState.DOWN); } //StartBt PlayerTwo if (Input.GetKeyUp(KeyCode.K)) { ClickStartBtTwo(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.K)) { ClickStartBtTwo(ButtonState.DOWN); } //setPanel enter button if (Input.GetKeyUp(KeyCode.F4)) { ClickSetEnterBt(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F4)) { ClickSetEnterBt(ButtonState.DOWN); } //setPanel move button if (Input.GetKeyUp(KeyCode.F5)) { ClickSetMoveBt(ButtonState.UP); //FramesPerSecond.GetInstance().ClickSetMoveBtEvent( ButtonState.UP ); } if (Input.GetKeyDown(KeyCode.F5)) { ClickSetMoveBt(ButtonState.DOWN); //FramesPerSecond.GetInstance().ClickSetMoveBtEvent( ButtonState.DOWN ); } //Fire button if (Input.GetKeyUp(KeyCode.Mouse0)) { IsClickFireBtOneDown = false; ClickFireBtOne(ButtonState.UP); IsClickFireBtTwoDown = false; ClickFireBtTwo(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse0)) { IsClickFireBtOneDown = true; ClickFireBtOne(ButtonState.DOWN); IsClickFireBtTwoDown = true; ClickFireBtTwo(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.Mouse1)) { IsClickDaoDanBtOneDown = false; ClickDaoDanBtOne(ButtonState.UP); IsClickDaoDanBtTwoDown = false; ClickDaoDanBtTwo(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse1)) { IsClickDaoDanBtOneDown = true; ClickDaoDanBtOne(ButtonState.DOWN); IsClickDaoDanBtTwoDown = true; ClickDaoDanBtTwo(ButtonState.DOWN); } if (Input.GetKeyDown(KeyCode.C)) { ClickStopDongGanBtOne(ButtonState.DOWN); } }
void Update() { #if !USE_PC_INPUT_TEST if (pcvr.bIsHardWare) { return; } #else IsUsePcInputTest = true; #endif #if UNITY_EDITOR //发布出来的游戏不允许用键盘进行投币. if (Input.GetKeyUp(KeyCode.T)) { if (pcvr.IsXuNiPhoneShouBing) { //红点点微信二维码游戏. if (XkGameCtrl.GetIsActivePlayer(PlayerEnum.PlayerOne) == false) { //该机位没有被激活. if (pcvr.GetInstance().m_HongDDGamePadInterface != null) { //清理玩家微信数据. pcvr.GetInstance().m_HongDDGamePadInterface.RemoveGamePlayerData(PlayerEnum.PlayerOne); } } } int coinVal = XKGlobalData.CoinPlayerOne + 1; XKGlobalData.SetCoinPlayerOne(coinVal); if (XKGlobalData.GetInstance().m_GameWXPayDataManage != null) { XKGlobalData.GetInstance().m_GameWXPayDataManage.WriteGamePayRevenueInfo(1); } } if (Input.GetKeyUp(KeyCode.Y)) { if (pcvr.IsXuNiPhoneShouBing) { //红点点微信二维码游戏. if (XkGameCtrl.GetIsActivePlayer(PlayerEnum.PlayerTwo) == false) { //该机位没有被激活. if (pcvr.GetInstance().m_HongDDGamePadInterface != null) { //清理玩家微信数据. pcvr.GetInstance().m_HongDDGamePadInterface.RemoveGamePlayerData(PlayerEnum.PlayerTwo); } } } int coinVal = XKGlobalData.CoinPlayerTwo + 1; XKGlobalData.SetCoinPlayerTwo(coinVal); if (XKGlobalData.GetInstance().m_GameWXPayDataManage != null) { XKGlobalData.GetInstance().m_GameWXPayDataManage.WriteGamePayRevenueInfo(1); } } if (Input.GetKeyUp(KeyCode.U)) { if (pcvr.IsXuNiPhoneShouBing) { //红点点微信二维码游戏. if (XkGameCtrl.GetIsActivePlayer(PlayerEnum.PlayerThree) == false) { //该机位没有被激活. if (pcvr.GetInstance().m_HongDDGamePadInterface != null) { //清理玩家微信数据. pcvr.GetInstance().m_HongDDGamePadInterface.RemoveGamePlayerData(PlayerEnum.PlayerThree); } } } if (XKGlobalData.GameVersionPlayer == 0) { int coinVal = XKGlobalData.CoinPlayerThree + 1; XKGlobalData.SetCoinPlayerThree(coinVal); if (XKGlobalData.GetInstance().m_GameWXPayDataManage != null) { XKGlobalData.GetInstance().m_GameWXPayDataManage.WriteGamePayRevenueInfo(1); } } } #endif //if (Input.GetKeyUp(KeyCode.I)) { // if (XKGlobalData.GameVersionPlayer == 0) { // int coinVal = XKGlobalData.CoinPlayerFour + 1; // XKGlobalData.SetCoinPlayerFour(coinVal); // } //} //StartBt PlayerOne if (Input.GetKeyUp(KeyCode.G)) { ClickStartBtOne(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.G)) { ClickStartBtOne(pcvr.ButtonState.DOWN); } //StartBt PlayerTwo if (Input.GetKeyUp(KeyCode.H)) { ClickStartBtTwo(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.H)) { ClickStartBtTwo(pcvr.ButtonState.DOWN); } //StartBt PlayerThree if (Input.GetKeyUp(KeyCode.J)) { ClickStartBtThree(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.J)) { ClickStartBtThree(pcvr.ButtonState.DOWN); } //StartBt PlayerFour //if (Input.GetKeyUp(KeyCode.K)) { // ClickStartBtFour( pcvr.ButtonState.UP ); //} //if (Input.GetKeyDown(KeyCode.K)) { // ClickStartBtFour( pcvr.ButtonState.DOWN ); //} if (XkGameCtrl.GetInstance() != null && XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer) { //没有玩家激活游戏. } else { //player_1. if (Input.GetKeyDown(KeyCode.A)) { //ClickFangXiangLBtP1(pcvr.ButtonState.DOWN); OnClickFangXiangLBt(0, pcvr.ButtonState.DOWN); if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true) { //测试玩家子弹,使玩家运动到一起. OnClickFangXiangLBt(1, pcvr.ButtonState.DOWN); OnClickFangXiangLBt(2, pcvr.ButtonState.DOWN); } OnPlayerDoPadDirection(PlayerEnum.PlayerOne); } if (Input.GetKeyUp(KeyCode.A)) { //ClickFangXiangLBtP1(pcvr.ButtonState.UP); OnClickFangXiangLBt(0, pcvr.ButtonState.UP); if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true) { //测试玩家子弹,使玩家运动到一起. OnClickFangXiangLBt(1, pcvr.ButtonState.UP); OnClickFangXiangLBt(2, pcvr.ButtonState.UP); } } if (Input.GetKeyDown(KeyCode.D)) { //ClickFangXiangRBtP1(pcvr.ButtonState.DOWN); OnClickFangXiangRBt(0, pcvr.ButtonState.DOWN); if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true) { //测试玩家子弹,使玩家运动到一起. OnClickFangXiangRBt(1, pcvr.ButtonState.DOWN); OnClickFangXiangRBt(2, pcvr.ButtonState.DOWN); } OnPlayerDoPadDirection(PlayerEnum.PlayerOne); } if (Input.GetKeyUp(KeyCode.D)) { //ClickFangXiangRBtP1(pcvr.ButtonState.UP); OnClickFangXiangRBt(0, pcvr.ButtonState.UP); if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true) { //测试玩家子弹,使玩家运动到一起. OnClickFangXiangRBt(1, pcvr.ButtonState.UP); OnClickFangXiangRBt(2, pcvr.ButtonState.UP); } } if (Input.GetKeyDown(KeyCode.W)) { //ClickFangXiangUBtP1(pcvr.ButtonState.DOWN); OnClickFangXiangUBt(0, pcvr.ButtonState.DOWN); if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true) { //测试玩家子弹,使玩家运动到一起. OnClickFangXiangUBt(1, pcvr.ButtonState.DOWN); OnClickFangXiangUBt(2, pcvr.ButtonState.DOWN); } OnPlayerDoPadDirection(PlayerEnum.PlayerOne); } if (Input.GetKeyUp(KeyCode.W)) { //ClickFangXiangUBtP1(pcvr.ButtonState.UP); OnClickFangXiangUBt(0, pcvr.ButtonState.UP); if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true) { //测试玩家子弹,使玩家运动到一起. OnClickFangXiangUBt(1, pcvr.ButtonState.UP); OnClickFangXiangUBt(2, pcvr.ButtonState.UP); } } if (Input.GetKeyDown(KeyCode.S)) { //ClickFangXiangDBtP1(pcvr.ButtonState.DOWN); OnClickFangXiangDBt(0, pcvr.ButtonState.DOWN); if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true) { //测试玩家子弹,使玩家运动到一起. OnClickFangXiangDBt(1, pcvr.ButtonState.DOWN); OnClickFangXiangDBt(2, pcvr.ButtonState.DOWN); } OnPlayerDoPadDirection(PlayerEnum.PlayerOne); } if (Input.GetKeyUp(KeyCode.S)) { //ClickFangXiangDBtP1(pcvr.ButtonState.UP); OnClickFangXiangDBt(0, pcvr.ButtonState.UP); if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true && XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true) { //测试玩家子弹,使玩家运动到一起. OnClickFangXiangDBt(1, pcvr.ButtonState.UP); OnClickFangXiangDBt(2, pcvr.ButtonState.UP); } } //player_2. if (Input.GetKeyDown(KeyCode.F)) { //ClickFangXiangLBtP2(pcvr.ButtonState.DOWN); OnClickFangXiangLBt(1, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerTwo); } if (Input.GetKeyUp(KeyCode.F)) { //ClickFangXiangLBtP2(pcvr.ButtonState.UP); OnClickFangXiangLBt(1, pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.H)) { //ClickFangXiangRBtP2(pcvr.ButtonState.DOWN); OnClickFangXiangRBt(1, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerTwo); } if (Input.GetKeyUp(KeyCode.H)) { //ClickFangXiangRBtP2(pcvr.ButtonState.UP); OnClickFangXiangRBt(1, pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.T)) { //ClickFangXiangUBtP2(pcvr.ButtonState.DOWN); OnClickFangXiangUBt(1, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerTwo); } if (Input.GetKeyUp(KeyCode.T)) { //ClickFangXiangUBtP2(pcvr.ButtonState.UP); OnClickFangXiangUBt(1, pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.G)) { //ClickFangXiangDBtP2(pcvr.ButtonState.DOWN); OnClickFangXiangDBt(1, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerTwo); } if (Input.GetKeyUp(KeyCode.G)) { //ClickFangXiangDBtP2(pcvr.ButtonState.UP); OnClickFangXiangDBt(1, pcvr.ButtonState.UP); } //player_3. if (Input.GetKeyDown(KeyCode.J)) { //ClickFangXiangLBtP3(pcvr.ButtonState.DOWN); OnClickFangXiangLBt(2, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerThree); } if (Input.GetKeyUp(KeyCode.J)) { //ClickFangXiangLBtP3(pcvr.ButtonState.UP); OnClickFangXiangLBt(2, pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.L)) { //ClickFangXiangRBtP3(pcvr.ButtonState.DOWN); OnClickFangXiangRBt(2, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerThree); } if (Input.GetKeyUp(KeyCode.L)) { //ClickFangXiangRBtP3(pcvr.ButtonState.UP); OnClickFangXiangRBt(2, pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.I)) { //ClickFangXiangUBtP3(pcvr.ButtonState.DOWN); OnClickFangXiangUBt(2, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerThree); } if (Input.GetKeyUp(KeyCode.I)) { //ClickFangXiangUBtP3(pcvr.ButtonState.UP); OnClickFangXiangUBt(2, pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.K)) { //ClickFangXiangDBtP3(pcvr.ButtonState.DOWN); OnClickFangXiangDBt(2, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerThree); } if (Input.GetKeyUp(KeyCode.K)) { //ClickFangXiangDBtP3(pcvr.ButtonState.UP); OnClickFangXiangDBt(2, pcvr.ButtonState.UP); } //player_4. if (Input.GetKeyDown(KeyCode.LeftArrow)) { //ClickFangXiangLBtP4(pcvr.ButtonState.DOWN); OnClickFangXiangLBt(3, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerFour); } if (Input.GetKeyUp(KeyCode.LeftArrow)) { //ClickFangXiangLBtP4(pcvr.ButtonState.UP); OnClickFangXiangLBt(3, pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.RightArrow)) { //ClickFangXiangRBtP4(pcvr.ButtonState.DOWN); OnClickFangXiangRBt(3, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerFour); } if (Input.GetKeyUp(KeyCode.RightArrow)) { //ClickFangXiangRBtP4(pcvr.ButtonState.UP); OnClickFangXiangRBt(3, pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.UpArrow)) { //ClickFangXiangUBtP4(pcvr.ButtonState.DOWN); OnClickFangXiangUBt(3, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerFour); } if (Input.GetKeyUp(KeyCode.UpArrow)) { //ClickFangXiangUBtP4(pcvr.ButtonState.UP); OnClickFangXiangUBt(3, pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.DownArrow)) { //ClickFangXiangDBtP4(pcvr.ButtonState.DOWN); OnClickFangXiangDBt(3, pcvr.ButtonState.DOWN); OnPlayerDoPadDirection(PlayerEnum.PlayerFour); } if (Input.GetKeyUp(KeyCode.DownArrow)) { //ClickFangXiangDBtP4(pcvr.ButtonState.UP); OnClickFangXiangDBt(3, pcvr.ButtonState.UP); } } //setPanel enter button if (Input.GetKeyUp(KeyCode.F4)) { ClickSetEnterBt(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F4)) { ClickSetEnterBt(pcvr.ButtonState.DOWN); } //setPanel move button if (Input.GetKeyUp(KeyCode.F5)) { ClickSetMoveBt(pcvr.ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F5)) { ClickSetMoveBt(pcvr.ButtonState.DOWN); } //Fire button if (Input.GetKeyUp(KeyCode.Mouse0)) { //OnClickFireBt(0, pcvr.ButtonState.UP); //OnClickFireBt(1, pcvr.ButtonState.UP); //OnClickFireBt(2, pcvr.ButtonState.UP); //OnClickFireBt(3, pcvr.ButtonState.UP); OnClickDaoDanBt(0, pcvr.ButtonState.UP); OnClickDaoDanBt(1, pcvr.ButtonState.UP); OnClickDaoDanBt(2, pcvr.ButtonState.UP); //OnClickDaoDanBt(3, pcvr.ButtonState.UP); OnPlayerDoPadButton(PlayerEnum.PlayerOne); OnPlayerDoPadButton(PlayerEnum.PlayerTwo); OnPlayerDoPadButton(PlayerEnum.PlayerThree); //OnPlayerDoPadButton(PlayerEnum.PlayerFour); } if (Input.GetKeyDown(KeyCode.Mouse0)) { //OnClickFireBt(0, pcvr.ButtonState.DOWN); //OnClickFireBt(1, pcvr.ButtonState.DOWN); //OnClickFireBt(2, pcvr.ButtonState.DOWN); //OnClickFireBt(3, pcvr.ButtonState.DOWN); OnClickDaoDanBt(0, pcvr.ButtonState.DOWN); OnClickDaoDanBt(1, pcvr.ButtonState.DOWN); OnClickDaoDanBt(2, pcvr.ButtonState.DOWN); //OnClickDaoDanBt(3, pcvr.ButtonState.DOWN); OnPlayerDoPadButton(PlayerEnum.PlayerOne); OnPlayerDoPadButton(PlayerEnum.PlayerTwo); OnPlayerDoPadButton(PlayerEnum.PlayerThree); //OnPlayerDoPadButton(PlayerEnum.PlayerFour); } if (Input.GetKeyUp(KeyCode.Mouse1)) { OnClickDaoDanBt(0, pcvr.ButtonState.UP); OnClickDaoDanBt(1, pcvr.ButtonState.UP); OnClickDaoDanBt(2, pcvr.ButtonState.UP); //OnClickDaoDanBt(3, pcvr.ButtonState.UP); OnPlayerDoPadButton(PlayerEnum.PlayerOne); OnPlayerDoPadButton(PlayerEnum.PlayerTwo); OnPlayerDoPadButton(PlayerEnum.PlayerThree); //OnPlayerDoPadButton(PlayerEnum.PlayerFour); } if (Input.GetKeyDown(KeyCode.Mouse1)) { OnClickDaoDanBt(0, pcvr.ButtonState.DOWN); OnClickDaoDanBt(1, pcvr.ButtonState.DOWN); OnClickDaoDanBt(2, pcvr.ButtonState.DOWN); //OnClickDaoDanBt(3, pcvr.ButtonState.DOWN); OnPlayerDoPadButton(PlayerEnum.PlayerOne); OnPlayerDoPadButton(PlayerEnum.PlayerTwo); OnPlayerDoPadButton(PlayerEnum.PlayerThree); //OnPlayerDoPadButton(PlayerEnum.PlayerFour); } //test //if (Input.GetKeyDown(KeyCode.P)) //{ // PcvrComInputEvent.GetInstance().ClickPcvrBt07(pcvr.ButtonState.DOWN); //} //if (Input.GetKeyUp(KeyCode.P)) //{ // PcvrComInputEvent.GetInstance().ClickPcvrBt07(pcvr.ButtonState.UP); //} //test }
void Update() { if (pcvr.bIsHardWare) { return; } if (Input.GetKeyUp(KeyCode.T) || Input.GetKeyUp(KeyCode.I)) { int coinVal = 0; switch (GameTypeCtrl.PlayerPCState) { case PlayerEnum.PlayerOne: coinVal = XKGlobalData.CoinPlayerOne + 1; XKGlobalData.SetCoinPlayerOne(coinVal); break; case PlayerEnum.PlayerTwo: coinVal = XKGlobalData.CoinPlayerTwo + 1; XKGlobalData.SetCoinPlayerTwo(coinVal); break; } } if (Input.GetKeyUp(KeyCode.G) || Input.GetKeyUp(KeyCode.K)) { switch (GameTypeCtrl.PlayerPCState) { case PlayerEnum.PlayerOne: ClickStartBtOne(ButtonState.UP); break; case PlayerEnum.PlayerTwo: ClickStartBtTwo(ButtonState.UP); break; default: if (Input.GetKeyUp(KeyCode.G)) { ClickStartBtOne(ButtonState.UP); } if (Input.GetKeyUp(KeyCode.K)) { ClickStartBtTwo(ButtonState.UP); } break; } } if (Input.GetKeyDown(KeyCode.G) || Input.GetKeyDown(KeyCode.K)) { switch (GameTypeCtrl.PlayerPCState) { case PlayerEnum.PlayerOne: ClickStartBtOne(ButtonState.DOWN); break; case PlayerEnum.PlayerTwo: ClickStartBtTwo(ButtonState.DOWN); break; default: if (Input.GetKeyDown(KeyCode.G)) { ClickStartBtOne(ButtonState.DOWN); } if (Input.GetKeyDown(KeyCode.K)) { ClickStartBtTwo(ButtonState.DOWN); } break; } } //setPanel enter button if (Input.GetKeyUp(KeyCode.F4)) { ClickSetEnterBt(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F4)) { ClickSetEnterBt(ButtonState.DOWN); } //setPanel move button if (Input.GetKeyUp(KeyCode.F5)) { ClickSetMoveBt(ButtonState.UP); //FramesPerSecond.GetInstance().ClickSetMoveBtEvent( ButtonState.UP ); } if (Input.GetKeyDown(KeyCode.F5)) { ClickSetMoveBt(ButtonState.DOWN); //FramesPerSecond.GetInstance().ClickSetMoveBtEvent( ButtonState.DOWN ); } //Fire button if (Input.GetKeyUp(KeyCode.Mouse0)) { IsClickFireBtOneDown = false; ClickFireBtOne(ButtonState.UP); IsClickFireBtTwoDown = false; ClickFireBtTwo(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse0)) { IsClickFireBtOneDown = true; ClickFireBtOne(ButtonState.DOWN); IsClickFireBtTwoDown = true; ClickFireBtTwo(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.Mouse1)) { IsClickDaoDanBtOneDown = false; ClickDaoDanBtOne(ButtonState.UP); IsClickDaoDanBtTwoDown = false; ClickDaoDanBtTwo(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse1)) { IsClickDaoDanBtOneDown = true; ClickDaoDanBtOne(ButtonState.DOWN); IsClickDaoDanBtTwoDown = true; ClickDaoDanBtTwo(ButtonState.DOWN); } if (Input.GetKeyDown(KeyCode.C)) { ClickStopDongGanBtOne(ButtonState.DOWN); } }
void Update() { // #if !UNITY_EDITOR // if (SetEnterBtSt == ButtonState.DOWN && Time.time - TimeSetEnterMoveBt > 2f) { // HardwareCheckCtrl.OnRestartGame(); // } // #endif if (pcvr.bIsHardWare && !TestTanKCom.IsTestTankCom && !pcvr.IsTestInput) { return; } if (Input.GetKeyUp(KeyCode.T)) { int coinVal = XKGlobalData.CoinPlayerOne + 1; XKGlobalData.SetCoinPlayerOne(coinVal); } if (Input.GetKeyUp(KeyCode.Y)) { int coinVal = XKGlobalData.CoinPlayerTwo + 1; XKGlobalData.SetCoinPlayerTwo(coinVal); } if (Input.GetKeyUp(KeyCode.U)) { if (XKGlobalData.GameVersionPlayer == 0) { int coinVal = XKGlobalData.CoinPlayerThree + 1; XKGlobalData.SetCoinPlayerThree(coinVal); } } if (Input.GetKeyUp(KeyCode.I)) { if (XKGlobalData.GameVersionPlayer == 0) { int coinVal = XKGlobalData.CoinPlayerFour + 1; XKGlobalData.SetCoinPlayerFour(coinVal); } } //StartBt PlayerOne if (Input.GetKeyUp(KeyCode.G)) { ClickStartBtOne(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.G)) { ClickStartBtOne(ButtonState.DOWN); } //StartBt PlayerTwo if (Input.GetKeyUp(KeyCode.H)) { ClickStartBtTwo(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.H)) { ClickStartBtTwo(ButtonState.DOWN); } //StartBt PlayerThree if (Input.GetKeyUp(KeyCode.J)) { ClickStartBtThree(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.J)) { ClickStartBtThree(ButtonState.DOWN); } //StartBt PlayerFour if (Input.GetKeyUp(KeyCode.K)) { ClickStartBtFour(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.K)) { ClickStartBtFour(ButtonState.DOWN); } //player_1. if (Input.GetKeyDown(KeyCode.A)) { ClickFangXiangLBtP1(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.A)) { ClickFangXiangLBtP1(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.D)) { ClickFangXiangRBtP1(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.D)) { ClickFangXiangRBtP1(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.W)) { ClickFangXiangUBtP1(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.W)) { ClickFangXiangUBtP1(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.S)) { ClickFangXiangDBtP1(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.S)) { ClickFangXiangDBtP1(ButtonState.UP); } //player_2. if (!TestTanKCom.IsTestTankCom) { if (Input.GetKeyDown(KeyCode.F)) { ClickFangXiangLBtP2(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.F)) { ClickFangXiangLBtP2(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.H)) { ClickFangXiangRBtP2(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.H)) { ClickFangXiangRBtP2(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.T)) { ClickFangXiangUBtP2(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.T)) { ClickFangXiangUBtP2(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.G)) { ClickFangXiangDBtP2(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.G)) { ClickFangXiangDBtP2(ButtonState.UP); } } else { PlayerYM[1] = TestTanKCom.YouMenStateP2; PlayerFX[1] = TestTanKCom.FangXiangStateP2; } //player_3. if (!TestTanKCom.IsTestTankCom) { if (Input.GetKeyDown(KeyCode.J)) { ClickFangXiangLBtP3(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.J)) { ClickFangXiangLBtP3(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.L)) { ClickFangXiangRBtP3(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.L)) { ClickFangXiangRBtP3(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.I)) { ClickFangXiangUBtP3(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.I)) { ClickFangXiangUBtP3(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.K)) { ClickFangXiangDBtP3(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.K)) { ClickFangXiangDBtP3(ButtonState.UP); } } else { PlayerFX[2] = TestTanKCom.FangXiangStateP3; PlayerYM[2] = TestTanKCom.YouMenStateP3; } //player_4. if (Input.GetKeyDown(KeyCode.LeftArrow)) { ClickFangXiangLBtP4(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.LeftArrow)) { ClickFangXiangLBtP4(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.RightArrow)) { ClickFangXiangRBtP4(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.RightArrow)) { ClickFangXiangRBtP4(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.UpArrow)) { ClickFangXiangUBtP4(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.UpArrow)) { ClickFangXiangUBtP4(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.DownArrow)) { ClickFangXiangDBtP4(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.DownArrow)) { ClickFangXiangDBtP4(ButtonState.UP); } //setPanel enter button if (Input.GetKeyUp(KeyCode.F4)) { ClickSetEnterBt(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F4)) { ClickSetEnterBt(ButtonState.DOWN); } //setPanel move button if (Input.GetKeyUp(KeyCode.F5)) { ClickSetMoveBt(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.F5)) { ClickSetMoveBt(ButtonState.DOWN); } //Fire button if (Input.GetKeyUp(KeyCode.Mouse0)) { IsClickFireBtOneDown = false; IsClickFireBtTwoDown = false; IsClickFireBtThreeDown = false; IsClickFireBtFourDown = false; ClickFireBtOne(ButtonState.UP); if (!TestTanKCom.IsTestTankCom) { ClickFireBtTwo(ButtonState.UP); ClickFireBtThree(ButtonState.UP); } ClickFireBtFour(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse0)) { IsClickFireBtOneDown = true; IsClickFireBtTwoDown = true; IsClickFireBtThreeDown = true; IsClickFireBtFourDown = true; ClickFireBtOne(ButtonState.DOWN); if (!TestTanKCom.IsTestTankCom) { ClickFireBtTwo(ButtonState.DOWN); ClickFireBtThree(ButtonState.DOWN); } ClickFireBtFour(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.Mouse1)) { ClickDaoDanBtOne(ButtonState.UP); if (!TestTanKCom.IsTestTankCom) { ClickDaoDanBtTwo(ButtonState.UP); ClickDaoDanBtThree(ButtonState.UP); } ClickDaoDanBtFour(ButtonState.UP); } if (Input.GetKeyDown(KeyCode.Mouse1)) { ClickDaoDanBtOne(ButtonState.DOWN); if (!TestTanKCom.IsTestTankCom) { ClickDaoDanBtTwo(ButtonState.DOWN); ClickDaoDanBtThree(ButtonState.DOWN); } ClickDaoDanBtFour(ButtonState.DOWN); } if (Input.GetKeyDown(KeyCode.C)) { ClickStopDongGanBtOne(ButtonState.DOWN); ClickStopDongGanBtTwo(ButtonState.DOWN); ClickStopDongGanBtThree(ButtonState.DOWN); ClickStopDongGanBtFour(ButtonState.DOWN); } if (Input.GetKeyUp(KeyCode.C)) { ClickStopDongGanBtOne(ButtonState.UP); ClickStopDongGanBtTwo(ButtonState.UP); ClickStopDongGanBtThree(ButtonState.UP); ClickStopDongGanBtFour(ButtonState.UP); } }