Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.XR;
  5. public class CustomCurvedUIRay : MonoBehaviour
  6. {
  7.     // Start is called before the first frame update
  8.  
  9.     public XRNode xrNode;
  10.     void Start()
  11.     {
  12.        OVRInput.Controller controller = OVRInput.GetConnectedControllers();
  13.         Debug.Log(controller);
  14.     }
  15.  
  16.     // Update is called once per frame
  17.     void Update()
  18.     {
  19.         CurvedUIInputModule.CustomControllerRay = new Ray(transform.position, transform.forward);
  20.         CurvedUIInputModule.CustomControllerButtonState =OVRInput.Get(OVRInput.RawAxis1D.RIndexTrigger) >= 0.8f;  
  21.  
  22.         if ((OVRInput.Get(OVRInput.RawAxis1D.RIndexTrigger)) >= 0.8f)
  23.         {
  24.             Debug.Log("Right vive trigger pressed from custom ray class");
  25.         }
  26.  
  27.         if ((OVRInput.Get(OVRInput.RawAxis1D.LIndexTrigger)) >= 0.8f)
  28.         {
  29.             Debug.Log("Left vive trigger pressed from custom ray class");
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement