This commit is contained in:
2025-05-16 23:31:59 +08:00
parent 9e4fef3f1e
commit d891e3f0ee
1198 changed files with 274242 additions and 1558 deletions

View File

@@ -0,0 +1,38 @@
using UnityEngine.InputSystem;
namespace ECM2.Examples.Glide
{
/// <summary>
/// Extends default Character Input to handle GlideAbility Input.
/// </summary>
public class GlideInput : CharacterInput
{
private GlideAbility _glideAbility;
/// <summary>
/// Extend OnJump handler to add GlideAbility input support.
/// </summary>
public override void OnJump(InputAction.CallbackContext context)
{
// Call base method implementation (handle jump)
base.OnJump(context);
if (context.started)
_glideAbility.Glide();
else if (context.canceled)
_glideAbility.StopGliding();
}
protected override void Awake()
{
base.Awake();
// Cache Glide Ability
_glideAbility = GetComponent<GlideAbility>();
}
}
}