Skip to content

Instantly share code, notes, and snippets.

@pr00thmatic
Last active November 2, 2025 02:33
Show Gist options
  • Select an option

  • Save pr00thmatic/3e93958e65ba909d8311bac29ccaabb6 to your computer and use it in GitHub Desktop.

Select an option

Save pr00thmatic/3e93958e65ba909d8311bac29ccaabb6 to your computer and use it in GitHub Desktop.
namespace HugeFailure
{
public class FailedHoldDetector : MonoBehaviour
{
public InputActionReference naiveHoldAction;
void OnEnable () => naiveHoldAction.action.performed += HandleHoldPerformed;
void OnDisable () => naiveHoldAction.action.performed -= HandleHoldPerformed;
private void HandleHoldPerformed (InputAction.CallbackContext context) =>
OnHoldSuccess?.Invoke();
public UnityEvent OnHoldSuccess { get; private set; } = new();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment