summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Input/InputManager.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-08-02 08:35:26 +0800
committerchai <chaifix@163.com>2021-08-02 08:35:26 +0800
commitce73a13f28e5a947df8f1f87f1f1be20010952ec (patch)
tree2c430bcd93f2c09bd35340def7c556c7294d6b5d /Assets/Scripts/Input/InputManager.cs
parent81acfeb9a1d88075899d9c21064330915caa59a4 (diff)
* 测试
Diffstat (limited to 'Assets/Scripts/Input/InputManager.cs')
-rw-r--r--Assets/Scripts/Input/InputManager.cs43
1 files changed, 40 insertions, 3 deletions
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<InputManager>
{
- 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.MoveParam>(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());
+ }
}