Пример #1
0
 /// <summary>
 /// Assign the PointerRayCast script to its variable
 /// </summary>
 void Initialize()
 {
     try
     {
         pointerRayCast     = SetupVR.ActiveSDK.GetComponent <PointerRayCast>();
         controllerAreSetup = true;
     }
     catch
     {
         Debug.Log("CameraRig is not on Scene yet.");
     }
 }
 void CheckReferences()
 {
     try
     {
         pointerRayCast = SetupVR.ActiveSDK.GetComponent <PointerRayCast>();
         imageCollider  = GetComponent <Collider>();
         image          = GetComponent <Image>();
         isSetup        = true;
     } catch
     {
         Debug.Log("CameraRig not on the scene yet.");
     }
 }
Пример #3
0
        /// <summary>
        /// Set the references for the pointerRayCast, the LeftHand and the RightHand
        /// </summary>
        /// <returns>True if everything is setup</returns>
        private bool CheckReferences()
        {
            if (SetupVR.ActiveSDK != null && pointerRayCast == null)
            {
                pointerRayCast = SetupVR.ActiveSDK.GetComponent <PointerRayCast>();
            }

            if (pointerRayCast == null)
            {
                return(false);
            }

            return(true);
        }
Пример #4
0
 private void CheckReferences()
 {
     try
     {
         pointerRaycast = SetupVR.ActiveSDK.GetComponent <PointerRayCast>();
         sliderCollider = GetComponent <BoxCollider>();
         m_Slider       = GetComponent <Slider>();
         startingRot    = transform.root.localRotation;
         isSetup        = true;
     }
     catch
     {
         Debug.Log("CameraRig not in Scene.");
     }
 }
        /// <summary>
        /// Set the references for the pointerRayCast, the LeftHand and the RightHand
        /// </summary>
        /// <returns>True if everything is setup</returns>
        bool CheckReferences()
        {
            if (RightHand == null)
            {
                RightHand = SetupVR.RightControllerTransform;
            }

            if (LeftHand == null)
            {
                LeftHand = SetupVR.LeftControllerTransform;
            }

            if (SetupVR.ActiveSDK != null && PointerRayCast == null)
            {
                PointerRayCast = SetupVR.ActiveSDK.GetComponent <PointerRayCast>();
            }

            if (PointerRayCast == null || LeftHand == null || RightHand == null)
            {
                return(false);
            }

            return(true);
        }