I'm trying to get touch events in the editor. However I'm not getting any events from the input action.
I have a very simple script:
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.EnhancedTouch;
public class GameManager : MonoBehaviour
{
public InputAction _touch;
void Awake()
{
TouchSimulation.Enable();
_touch.started += OnTouch;
_touch.performed += OnTouch;
_touch.canceled += OnTouch;
}
void OnTouch(InputAction.CallbackContext context)
{
Debug.Log(context.ReadValueAsObject());
}
}
So a simple InputAction _touch and I subscribe to all its events.
I also enable touch simulation in the Awake function using TouchSimulation.Enable().
Then in the inspector I set it up like this:
The settings of the Input Action are:
And those of the Primary Touch are:
When I click and drag my mouse in the game view nothing happens, no events are fired.
What am I doing wrong? What more do I need for getting touch events and simulating them in the editor?
I'm running Unity 2019.4.
Thanks!


