Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.XR;
- public class CustomCurvedUIRay : MonoBehaviour
- {
- // Start is called before the first frame update
- public XRNode xrNode;
- void Start()
- {
- OVRInput.Controller controller = OVRInput.GetConnectedControllers();
- Debug.Log(controller);
- }
- // Update is called once per frame
- void Update()
- {
- CurvedUIInputModule.CustomControllerRay = new Ray(transform.position, transform.forward);
- CurvedUIInputModule.CustomControllerButtonState =OVRInput.Get(OVRInput.RawAxis1D.RIndexTrigger) >= 0.8f;
- if ((OVRInput.Get(OVRInput.RawAxis1D.RIndexTrigger)) >= 0.8f)
- {
- Debug.Log("Right vive trigger pressed from custom ray class");
- }
- if ((OVRInput.Get(OVRInput.RawAxis1D.LIndexTrigger)) >= 0.8f)
- {
- Debug.Log("Left vive trigger pressed from custom ray class");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement