I can’t seem to get events to fire from .cancelled callbacks when I use the InputActions assets.
This is the code.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Input;
public class TestMe : MonoBehaviour
{
[SerializeField]
private MyActions foo;
[SerializeField] InputAction up;
private void Awake()
{
foo = new MyActions();
foo.Player.Wicked.performed += context => Debug.Log("performed, pressing 'space'");
foo.Player.Wicked.cancelled += context => Debug.Log("cancelled, released 'space'");
up.continuous = true;
up.performed += context => Debug.Log("performed pressing 't'");
up.cancelled += context => Debug.Log("cancelled, released 't'");
}
private void OnEnable()
{
foo.Enable();
up.Enable();
}
private void OnDisable()
{
foo.Disable();
up.Disable();
}
}
But I can get .cancelled callbacks from InputActions that I assign in the inspector window.
I am using Unity 2019.1.1f1 and Input System package 0.2.8