using System.Collections; using System.Collections.Generic; using SC.XR.Unity.Module_InputSystem; using UnityEngine; using UnityEngine.XR.VisionOS; using UnityEngine.XR.VisionOS.InputDevices; public class VisionOSInputManager : MonoBehaviour { PointerInput m_PointerInput; void OnEnable() { m_PointerInput ??= new PointerInput(); m_PointerInput.Enable(); } void OnDisable() { m_PointerInput.Disable(); } void Update() { var primaryTouch = m_PointerInput.Default.PrimaryPointer.ReadValue(); var phase = primaryTouch.phase; var began = phase == VisionOSSpatialPointerPhase.Began; var ended = phase == VisionOSSpatialPointerPhase.Ended; var active = began || phase == VisionOSSpatialPointerPhase.Moved; if (began) { API_GSXR_Module_InputSystem_Head.GSXR_Head.inputDataHead.inputKeys.InputDataAddKey(InputKeyCode.Enter, InputKeyState.DOWN); Debug.Log("beganbeganbeganbeganbegan"); } if (ended) { API_GSXR_Module_InputSystem_Head.GSXR_Head.inputDataHead.inputKeys.InputDataAddKey(InputKeyCode.Enter, InputKeyState.UP); Debug.Log("endedendedendedendedendedended"); } if (active) { } } }