new input system movement
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
|
||||
|
||||
public class Player : Character
|
||||
{
|
||||
[SerializeField]
|
||||
@@ -30,10 +27,11 @@ public class Player : Character
|
||||
private GameObject _hammer;
|
||||
|
||||
private bool _isHoldingHammer = true;
|
||||
|
||||
|
||||
public event EventHandler<TreasureType> OnPlayerTakeItem;
|
||||
|
||||
public InputActions _inputActions = new InputActions();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance != null)
|
||||
@@ -45,8 +43,7 @@ public class Player : Character
|
||||
PlayerPrefs.SetString("lastExitName", string.Empty);
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
||||
|
||||
_inputActions.Enable();
|
||||
}
|
||||
|
||||
public void AddCoin()
|
||||
@@ -88,7 +85,8 @@ public class Player : Character
|
||||
_animator.SetTrigger("Body_ThrowHammer");
|
||||
}
|
||||
}
|
||||
base.MoveTo(Input.GetAxisRaw("Horizontal"), isAllowVertical? Input.GetAxisRaw("Vertical"):0);
|
||||
var move=_inputActions.Player.Movement.ReadValue<Vector2>();
|
||||
base.MoveTo(move.x, isAllowVertical? move.y:0);
|
||||
}
|
||||
|
||||
public void ThrowHammerObject()
|
||||
|
||||
Reference in New Issue
Block a user