기본 공격 구현
This commit is contained in:
@@ -10,6 +10,7 @@ public class InputManager : MonoBehaviour, GameInput.ICharacterActions
|
||||
private GameInput _input;
|
||||
|
||||
public event Action<Vector2> OnMove_Event;
|
||||
public event Action OnAttack_Event;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -39,4 +40,10 @@ public void OnMove(InputAction.CallbackContext ctx)
|
||||
if (ctx.phase == InputActionPhase.Performed || ctx.phase == InputActionPhase.Canceled)
|
||||
OnMove_Event?.Invoke(ctx.ReadValue<Vector2>());
|
||||
}
|
||||
|
||||
public void OnAttack(InputAction.CallbackContext ctx)
|
||||
{
|
||||
if (ctx.phase == InputActionPhase.Started)
|
||||
OnAttack_Event?.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user