Skip to main content

ITouchHandler

Interface to handle touch events on the trackpad.

MethodDescription
OnTouchStartCalled when touch started
OnTouchStopCalled when touch stopped
OnTouchUpdatedCalled when touch position updated
using JMRSDK.InputModule;
using UnityEngine;
public class InterfaceExample: MonoBehaviour, ITouchHandler
{
public void OnTouchStart(TouchEventData eventData, Vector2 TouchData) {
Debug.Log("OnTouchStarted " + TouchData.ToString());
}
public void OnTouchStop(TouchEventData eventData, Vector2 TouchData) {
Debug.Log("OnTouchStop " + TouchData.ToString());
}
public void OnTouchUpdated(TouchEventData eventData, Vector2 TouchData) {
Debug.Log("OnTouchUpdated " + TouchData.ToString());
}
}

TouchEventData

DatatypeVariableDescription
EventSystems.BaseInputModulecurrentInputModuleGet the currently active Input Module
GameObjectselectedObjectGet the currently selected object
Vector2TouchVectorGet Touch Position