Touch Input - VirtueSky/sunflower_2 GitHub Wiki
What
- Touch handling support tool for unity games (use Touch Phase)
Use
- Attach
TouchInputManager
to the scene and click create InputEvent

- Demo script uses
TouchInputManager
(move gameobject cube by touch or mouse)
private void OnEnable()
{
TouchInputManager.InputEventTouchBegin += StartTouch;
TouchInputManager.InputEventTouchMove += MoveTouch;
TouchInputManager.InputEventTouchEnd += EndTouch;
TouchInputManager.InputEventTouchStationary += StationTouch;
TouchInputManager.InputEventTouchCancel += CancelTouch;
}
#region Touch
private void StartTouch(Vector3 v3)
{
Debug.Log($"start: {v3}");
}
private void MoveTouch(Vector3 v3)
{
Debug.Log($"move: {v3}");
}
private void EndTouch(Vector3 v3)
{
Debug.Log($"end: {v3}");
}
private void StationTouch(Vector3 v3)
{
Debug.Log($"station: {v3}");
}
private void CancelTouch(Vector3 v3)
{
Debug.Log($"cancel: {v3}");
}
#endregion