From ce73a13f28e5a947df8f1f87f1f1be20010952ec Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 2 Aug 2021 08:35:26 +0800 Subject: =?UTF-8?q?*=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Input/InputManager.cs | 43 +++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'Assets/Scripts/Input/InputManager.cs') diff --git a/Assets/Scripts/Input/InputManager.cs b/Assets/Scripts/Input/InputManager.cs index ec74b0cf..47617c36 100644 --- a/Assets/Scripts/Input/InputManager.cs +++ b/Assets/Scripts/Input/InputManager.cs @@ -6,10 +6,47 @@ using UnityEngine; public class InputManager : SingletonMB { - public void InputMove() - { + PCController _pc; - } + PCController pc + { + get + { + if (_pc == null) + _pc = PCController.instance; + return _pc; + } + } + public void OnMoveRight() + { + UnitState.MoveParam move = new UnitState.MoveParam(); + move.isRight = true; + move.key = "d"; + pc.unitState.ChangeState(UnitState.EUnitState.Move, move); + } + + public void OnMoveLeft() + { + UnitState.MoveParam move = new UnitState.MoveParam(); + move.isRight = false; + move.key = "a"; + pc.unitState.ChangeState(UnitState.EUnitState.Move, move, true); + } + + public void OnTurnBack() + { + + } + + public void OnJump() + { + pc.unitState.ChangeState(UnitState.EUnitState.Jump, new UnitState.JumpParam()); + } + + public void OnAttack() + { + pc.unitState.ChangeState(UnitState.EUnitState.Skill, new UnitState.SkillParam()); + } } -- cgit v1.1-26-g67d0