This should work right?
I have a similar setup in a project made in 2019.3.0b4 (or was it b3)
And that project still works in b8
But in any new projects I make I cant get the new input system to work.
Active Input Handling in player settings is Both (also tried with input system only)
using UnityEngine;
using UnityEngine.InputSystem;
public class AnyKeyTest : MonoBehaviour
{
public InputActionAsset inputActionAsset;
InputAction action;
private void Awake( )
{
var inputActions = inputActionAsset.FindActionMap( "any" );
action = inputActions.FindAction( "any" );
}
private void OnEnable( )
{
action.started += OnStarted;
action.performed += OnPerformed;
action.canceled += OnCanceled;
}
private void OnDisable( )
{
action.started -= OnStarted;
action.performed -= OnPerformed;
action.canceled -= OnCanceled;
}
private void OnStarted( InputAction.CallbackContext obj )
{
Debug.Log( "started" );
}
private void OnCanceled( InputAction.CallbackContext obj )
{
Debug.Log( "canceled" );
}
public void OnPerformed( InputAction.CallbackContext obj )
{
Debug.Log( "Performed" );
}
}