diff options
author | chai <chaifix@163.com> | 2021-08-02 08:35:26 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-08-02 08:35:26 +0800 |
commit | ce73a13f28e5a947df8f1f87f1f1be20010952ec (patch) | |
tree | 2c430bcd93f2c09bd35340def7c556c7294d6b5d /Assets/Scripts/Input | |
parent | 81acfeb9a1d88075899d9c21064330915caa59a4 (diff) |
* 测试
Diffstat (limited to 'Assets/Scripts/Input')
-rw-r--r-- | Assets/Scripts/Input/InputManager.cs | 43 |
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());
+ }
}
|