Beispiel #1
0
        // Token: 0x06001328 RID: 4904 RVA: 0x0006B6F4 File Offset: 0x000698F4
        public override GameObject GetControllerRightHand(bool actual = false)
        {
            GameObject gameObject = this.GetSDKManagerControllerRightHand(actual);

            if (gameObject == null && actual)
            {
                gameObject = VRTK_SharedMethods.FindEvenInactiveGameObject <SteamVR_ControllerManager>("Controller (right)");
            }
            return(gameObject);
        }
        /// <summary>
        /// The GetControllerRightHand method returns the GameObject containing the representation of the right hand controller.
        /// </summary>
        /// <param name="actual">If true it will return the actual controller, if false it will return the script alias controller GameObject.</param>
        /// <returns>The GameObject containing the right hand controller.</returns>
        public override GameObject GetControllerRightHand(bool actual = false)
        {
            GameObject controller = GetSDKManagerControllerRightHand(actual);

            if (controller == null && actual)
            {
                controller = VRTK_SharedMethods.FindEvenInactiveGameObject <SDK_UnityCameraRig>("RightHandAnchor");
            }
            return(controller);
        }
Beispiel #3
0
 /// <summary>
 /// The FindInScene method is used to find the `[VRSimulator_CameraRig]` GameObject within the current scene.
 /// </summary>
 /// <returns>Returns the found `[VRSimulator_CameraRig]` GameObject if it is found. If it is not found then it prints a debug log error.</returns>
 public static GameObject FindInScene()
 {
     if (cachedCameraRig == null && !destroyed)
     {
         cachedCameraRig = VRTK_SharedMethods.FindEvenInactiveGameObject <SDK_InputSimulator>();
         if (!cachedCameraRig)
         {
             VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_SCENE, "[VRSimulator_CameraRig]", "SDK_InputSimulator", ". check that the `VRTK/Prefabs/CameraRigs/[VRSimulator_CameraRig]` prefab been added to the scene."));
         }
     }
     return(cachedCameraRig);
 }
Beispiel #4
0
 /// <summary>
 /// The FindInScene method is used to find the `VRSimulatorCameraRig` GameObject within the current scene.
 /// </summary>
 /// <returns>Returns the found `VRSimulatorCameraRig` GameObject if it is found. If it is not found then it prints a debug log error.</returns>
 public static GameObject FindInScene()
 {
     if (cachedCameraRig == null && !destroyed)
     {
         cachedCameraRig = VRTK_SharedMethods.FindEvenInactiveGameObject <SDK_InputSimulator>();
         if (!cachedCameraRig)
         {
             Debug.LogError("No GameObject with `SDK_InputSimulator` is found in the scene, have you added the `VRTK/Prefabs/VRSimulatorCameraRig` prefab to the scene?");
         }
     }
     return(cachedCameraRig);
 }
Beispiel #5
0
 /// <summary>
 /// The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
 /// </summary>
 /// <returns>A transform of the object representing the headset in the scene.</returns>
 public override Transform GetHeadset()
 {
     cachedHeadset = GetSDKManagerHeadset();
     if (cachedHeadset == null)
     {
         GameObject foundHeadset = VRTK_SharedMethods.FindEvenInactiveGameObject <SDK_UnityHeadsetTracker>(null, true);
         if (foundHeadset != null)
         {
             cachedHeadset = foundHeadset.transform;
         }
     }
     return(cachedHeadset);
 }
        /// <summary>
        /// The GetPlayArea method returns the Transform of the object that is used to represent the play area in the scene.
        /// </summary>
        /// <returns>A transform of the object representing the play area in the scene.</returns>
        public override Transform GetPlayArea()
        {
            cachedPlayArea = GetSDKManagerPlayArea();
            if (cachedPlayArea == null)
            {
                GameObject foundCameraRig = VRTK_SharedMethods.FindEvenInactiveGameObject <SDK_UnityCameraRig>(null, true);
                if (foundCameraRig != null)
                {
                    cachedPlayArea = foundCameraRig.transform;
                }
            }

            return(cachedPlayArea);
        }
Beispiel #7
0
 // Token: 0x060012C6 RID: 4806 RVA: 0x000697CC File Offset: 0x000679CC
 public static GameObject FindInScene()
 {
     if (SDK_InputSimulator.cachedCameraRig == null && !SDK_InputSimulator.destroyed)
     {
         SDK_InputSimulator.cachedCameraRig = VRTK_SharedMethods.FindEvenInactiveGameObject <SDK_InputSimulator>(null);
         if (!SDK_InputSimulator.cachedCameraRig)
         {
             VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_SCENE, new object[]
             {
                 "VRSimulatorCameraRig",
                 "SDK_InputSimulator",
                 ". check that the `VRTK/Prefabs/VRSimulatorCameraRig` prefab been added to the scene."
             }));
         }
     }
     return(SDK_InputSimulator.cachedCameraRig);
 }