Project structure, add docs update unity version
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
public class InputManager : MonoBehaviour
|
||||
{
|
||||
private InputActions _inputActions;
|
||||
|
||||
public event EventHandler<Vector2> OnMovementInput;
|
||||
public event EventHandler OnFireButtonPressed;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_inputActions = new InputActions();
|
||||
_inputActions.Player.Movement.performed += ctx => OnMovementInput?.Invoke(ctx.ReadValue<Vector2>());
|
||||
_inputActions.Player.Fire.performed += ctx => OnFireButtonPressed?.Invoke();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
_inputActions.Enable();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
_inputActions.Disable();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user