Skip to main content

ISelectHandler

Interface to handle select button inputs like OnSelectDown & OnSelectUp.

MethodDescription
OnSelectDownCalled when select button is pressed down
OnSelectUpCalled when select button is released
using JMRSDK.InputModule;
using UnityEngine;
public class InterfaceExample: MonoBehaviour, ISelectHandler
{
public void OnSelectDown(SelectEventData eventData) {
if (eventData.PressType == JMRInteractionSourceInfo.Select){
Debug.Log("OnSelectDown");
}
}
public void OnSelectUp(SelectEventData eventData) {
if (eventData.PressType == JMRInteractionSourceInfo.Select){
Debug.Log("OnSelectUp");
}
}
}

SelectEventData

EventSystems.BaseInputModulecurrentInputModuleGet the currently active Input Module
GameObjectselectedObjectGet the currently selected object
success

You can use OnSelectDown and OnSelectUp to get the inputs of all the buttons using

eventData.PressType

This can be used in the following ways

eventData.PressType == JMRInteractionSourceInfo.Select
eventData.PressType == JMRInteractionSourceInfo.Back
eventData.PressType == JMRInteractionSourceInfo.Home
eventData.PressType == JMRInteractionSourceInfo.Function