-
Notifications
You must be signed in to change notification settings - Fork 2
Touch Input
VirtueSky edited this page Jul 25, 2024
·
3 revisions
- Touch handling support tool for unity games (use Touch Phase)
- Attach
TouchInputManager
to the scene and click createInputEvent
- 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