/// <summary> /// ボタンが押された時の処理 /// </summary> private void Move(ButtonType btn) { switch (btn) { case ButtonType.JUMP: _onCrossCross = true; if (crossAxisDown.getKeepDown) { return; } //アイテムを捨てる処理 if (alchemyUI_ctr.ChooseWindow) { alchemyUI_ctr.ChooseThrow(false); return; } if (player_ctr.GetAlchemyUIFlag) { alchemyUI_ctr.ActiveThrowItemUI(); return; } if (!leg_col.isLanding) { return; } if (player_ctr.GetAlchemyUIFlag) { return; } //ジャンプの方向別アニメーション if (direc == Direction.RIGHT) { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.RIGHTJUMP); } else { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LEFTJUMP); } rig.velocity = new Vector2(5, 1f * speed); //弟のジャンプ処理 PotObject.GetComponent <PotController>().JumpPot(); _jumping = true; break; case ButtonType.LEFTJOYSTICK_LEFT: if (direc != Direction.LEFT && Jumping) { return; } else if (direc == Direction.LEFT && Jumping) { } //右ジョイスティックとジャンプ同時押し direc = Direction.LEFT; if (!_ActiveRightLeft) { return; } if (player_ctr.GetAlchemyUIFlag) { return; } if (leg_col.isLanding && !Jumping) { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LEFT_WALK); } if (CheckMoveable()) { rig.velocity = new Vector2(-5f, rig.velocity.y); } //弟の移動処理 PotObject.GetComponent <PotController>().LeftMove(); break; case ButtonType.LEFTJOYSTICK_RIGHT: if (direc != Direction.RIGHT && Jumping) { return; } else if (direc == Direction.RIGHT && Jumping) { } //右ジョイスティックとジャンプ同時押し direc = Direction.RIGHT; if (!_ActiveRightLeft) { return; } if (player_ctr.GetAlchemyUIFlag) { return; } if (leg_col.isLanding && !Jumping) { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.RIGHT_WALK); } if (CheckMoveable()) { rig.velocity = new Vector2(5f, rig.velocity.y); } //弟の移動処理 PotObject.GetComponent <PotController>().RightMove(); break; case ButtonType.LEFTJOYSTICK_UP: _onUp = true; ladderDownFlag = false; if (player_ctr.GetAlchemyUIFlag) { return; } if (InLadderCount > 0) { Ladder(ladderSpeed, 1); anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LADDER_UP); } break; case ButtonType.LEFTJOYSTICK_DOWN: _onDown = true; if (player_ctr.GetAlchemyUIFlag) { return; } if (ladderDownFlag) { return; } if (InLadderCount > 0) { Ladder(ladderSpeed, -1); anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LADDER_UP); } break; case ButtonType.RIGHTJOYSTICK_LEFT: //錬金UIが閉じてたらreturn if (!player_ctr.GetAlchemyUIFlag) { return; } _onRJoystickLeft = true; break; case ButtonType.RIGHTJOYSTICK_RIGHT: //錬金UIが閉じてたらreturn if (!player_ctr.GetAlchemyUIFlag) { return; } _onRJoystickRight = true; break; case ButtonType.RIGHTJOYSTICK_UP: //錬金UIが閉じてたらreturn if (!player_ctr.GetAlchemyUIFlag) { return; } _onRJoystickUp = true; break; case ButtonType.RIGHTJOYSTICK_DOWN: //錬金UIが閉じてたらreturn if (!player_ctr.GetAlchemyUIFlag) { return; } _onRJoystickDown = true; break; case ButtonType.CIRCLE: _onCircle = true; //錬金UI中の捨てるかどうかのウィンドウが出ている時に〇を押した時の処理 if (alchemyUI_ctr.ChooseWindow) { alchemyUI_ctr.ChooseThrow(true); return; } //錬金UIが出ている時に〇を押した時の処理 if (player_ctr.GetAlchemyUIFlag) { alchemyUI_ctr.PickItem(); } else { if (gameObject.layer == LayerMask.NameToLayer("LadderPlayer")) { return; } if (direc == Direction.LEFT) { if (pManager.GetSwordType == PlayerStatus.SWORDTYPE.VAJURA) { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LEFT_VAJURA); } else { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.SWORDATTACK_LEFT); } } else { if (pManager.GetSwordType == PlayerStatus.SWORDTYPE.VAJURA) { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.RIGHT_VAJURA); } else { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.SWORDATTACK_RIGHT); } } } break; case ButtonType.SQUARE: _onSquare = true; //スイッチを踏む処理 if (switchGimmick != null) { if (direc == Direction.LEFT) { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LEFTIDLE); } else { anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.RIGHTIDLE); } rig.velocity = new Vector2(0, 0); GimmickController gCon = switchGimmick.GetComponent <GimmickController>(); gCon.StartSride(); return; } //アイテムを拾う処理 bringctr.SquereButton(); player_ctr.pickUpFlag = true; target = null; break; case ButtonType.TRIANGLE: //錬金したアイテム使用 if (player_ctr.getCreateItemList().Count <= 0) { return; } player_ctr.UseAlchemyItem(alchemyUI_ctr.getNowAlchemyItem); break; case ButtonType.R1: //錬金したアイテムの切り替え if (player_ctr.getCreateItemList().Count <= 1) { return; } alchemyUI_ctr.setNowAlchemyItem(); break; case ButtonType.L2: //全体のマップを表示する処理 miniMap_ctr.ActiveMiniMap(); break; case ButtonType.R2: //錬金UIを開いたり閉じたりする処理 if (_jumping) { return; } player_ctr.OpenAlchemy(); break; case ButtonType.OPTION: //PouseManagerにOption処理が書いてある(Escapeと同じ処理) break; case ButtonType.CROSSX_RIGTH: //剣の切り替え if (!player_ctr.GetAlchemyUIFlag) { player_ctr.SwordNumList(1); return; } _onCrossRight = true; break; case ButtonType.CROSSX_LEFT: //剣の切り替え if (!player_ctr.GetAlchemyUIFlag) { player_ctr.SwordNumList(3); return; } _onCrossLeft = true; break; case ButtonType.CROSSY_UP: //剣の切り替え if (!player_ctr.GetAlchemyUIFlag) { player_ctr.SwordNumList(0); return; } _onCrossUp = true; break; case ButtonType.CROSSY_DOWN: //剣の切り替え if (!player_ctr.GetAlchemyUIFlag) { player_ctr.SwordNumList(2); return; } _onCrossDown = true; break; } }