public enum JMRInteractionManager.InteractionDeviceType
JIOGLASS_CONTROLLER = 1
KEYBOARD = 2
MOUSE = 3
VIRTUAL_CONRTOLLER = 4
VIRTUAL_KEYBOARD = 5
EDITOR_MOUSE = 6
GAZE_AND_CLICK = 7
GAZE_AND_DWELL = 8
GAMEPAD = 9
INVALID_DEVICE_TYPE = 0
Copy using JMRSDK.InputModule;
using UnityEngine;
public class InteractionDeviceFetcher : MonoBehaviour
{
JMRInteractionManager.InteractionDeviceType _addedDevice = 0;
private JMRInteractionManager.InteractionDeviceType InteractionDeviceType =>
_addedDevice == 0 ? JMRInteractionManager.Instance.GetSupportedInteractionDeviceType() : _addedDevice;
public JMRInteractionManager.InteractionDeviceType GetInteractionDeviceType() => InteractionDeviceType;
private void OnEnable()
{
JMRInteractionManager.OnConnected += OnConnect;
JMRInteractionManager.OnDisconnected += OnDisconnect;
}
private void OnDisable()
{
JMRInteractionManager.OnConnected -= OnConnect;
JMRInteractionManager.OnDisconnected -= OnDisconnect;
}
private void OnConnect(JMRInteractionManager.InteractionDeviceType devType, int index, string val)
{
_addedDevice = devType;
}
private void OnDisconnect(JMRInteractionManager.InteractionDeviceType devType, int index, string val)
{
_addedDevice = 0;
}
}