This commit is contained in:
2025-05-11 00:46:26 +08:00
parent 366f9e95ec
commit 618f75f911
2404 changed files with 154475 additions and 924730 deletions

View File

@@ -0,0 +1,36 @@
using UnityEngine.InputSystem;
namespace ECM2.Examples.Jump
{
/// <summary>
/// Extends default Character Input to handle JumpAbility Input.
/// </summary>
public class JumpInput : CharacterInput
{
// The jump ability
private JumpAbility _jumpAbility;
/// <summary>
/// Extend OnJump handler to manage JumpAbility input.
/// </summary>
public override void OnJump(InputAction.CallbackContext context)
{
if (context.started)
_jumpAbility.Jump();
else if (context.canceled)
_jumpAbility.StopJumping();
}
protected override void Awake()
{
base.Awake();
// Cache JumpAbility
_jumpAbility = GetComponent<JumpAbility>();
}
}
}