Implement Punch

This commit is contained in:
RochesterX
2025-01-17 12:57:43 -05:00
parent edce0c1702
commit 0824f3c99a
7 changed files with 476 additions and 215 deletions

22
Assets/Punch.cs Normal file
View File

@@ -0,0 +1,22 @@
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(PlayerInput))]
[RequireComponent(typeof(AnimationPlayer))]
public class Punch : MonoBehaviour
{
InputActionAsset actions;
private void Start()
{
actions = GetComponent<PlayerInput>().actions;
}
private void Update()
{
if (actions.FindAction("Punch").ReadValue<float>() == 1f)
{
GetComponent<AnimationPlayer>().Punch();
}
}
}