Example #1
0
        protected virtual void OnEnable()
        {
            GameObject simPlayer = SDK_InputSimulator.FindInScene();

            if (simPlayer != null)
            {
                rightController = simPlayer.transform.FindChild(RIGHT_HAND_CONTROLLER_NAME).GetComponent <SDK_ControllerSim>();
                leftController  = simPlayer.transform.FindChild(LEFT_HAND_CONTROLLER_NAME).GetComponent <SDK_ControllerSim>();
            }
        }
Example #2
0
 // Token: 0x060012D7 RID: 4823 RVA: 0x0006A7A0 File Offset: 0x000689A0
 public override Transform GetPlayArea()
 {
     if (this.area == null)
     {
         GameObject gameObject = SDK_InputSimulator.FindInScene();
         if (gameObject)
         {
             this.area = gameObject.transform;
         }
     }
     return(this.area);
 }
Example #3
0
 protected virtual void SetupPlayer()
 {
     if (rightController == null || leftController == null)
     {
         GameObject simPlayer = SDK_InputSimulator.FindInScene();
         if (simPlayer != null)
         {
             rightController = (rightController == null ? simPlayer.transform.Find(RIGHT_HAND_CONTROLLER_NAME).GetComponent <SDK_ControllerSim>() : rightController);
             leftController  = (leftController == null ? simPlayer.transform.Find(LEFT_HAND_CONTROLLER_NAME).GetComponent <SDK_ControllerSim>() : leftController);
         }
     }
 }
Example #4
0
            public SimControllers()
            {
                GameObject simPlayer = SDK_InputSimulator.FindInScene();

                if (simPlayer)
                {
                    rightHand       = simPlayer.transform.Find(RIGHT_HAND_CONTROLLER_NAME);
                    leftHand        = simPlayer.transform.Find(LEFT_HAND_CONTROLLER_NAME);
                    rightController = rightHand.GetComponent <SDK_ControllerSim>();
                    leftController  = leftHand.GetComponent <SDK_ControllerSim>();
                }
            }
Example #5
0
        /// <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 = null;
            GameObject simPlayer  = SDK_InputSimulator.FindInScene();

            if (simPlayer != null)
            {
                controller = simPlayer.transform.FindChild("RightHand").gameObject;
            }

            return(controller);
        }
Example #6
0
            public SimControllers()
            {
                GameObject simPlayer = SDK_InputSimulator.FindInScene();

                if (simPlayer)
                {
                    rightHand       = simPlayer.transform.FindChild("RightHand");
                    leftHand        = simPlayer.transform.FindChild("LeftHand");
                    rightController = rightHand.GetComponent <SDK_ControllerSim>();
                    leftController  = leftHand.GetComponent <SDK_ControllerSim>();
                }
            }
Example #7
0
 // Token: 0x06001307 RID: 4871 RVA: 0x0006B080 File Offset: 0x00069280
 public override Transform GetHeadset()
 {
     if (this.camera == null)
     {
         GameObject gameObject = SDK_InputSimulator.FindInScene();
         if (gameObject)
         {
             this.camera = gameObject.transform.Find("Neck/Camera");
         }
     }
     return(this.camera);
 }
Example #8
0
 // Token: 0x060012FC RID: 4860 RVA: 0x0006AC90 File Offset: 0x00068E90
 protected virtual void SetupPlayer()
 {
     if (this.rightController == null || this.leftController == null)
     {
         GameObject gameObject = SDK_InputSimulator.FindInScene();
         if (gameObject != null)
         {
             this.rightController = ((this.rightController == null) ? gameObject.transform.Find("RightHand").GetComponent <SDK_ControllerSim>() : this.rightController);
             this.leftController  = ((this.leftController == null) ? gameObject.transform.Find("LeftHand").GetComponent <SDK_ControllerSim>() : this.leftController);
         }
     }
 }
Example #9
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()
        {
            if (camera == null)
            {
                GameObject simPlayer = SDK_InputSimulator.FindInScene();
                if (simPlayer)
                {
                    camera = simPlayer.transform.FindChild("Camera");
                }
            }

            return(camera);
        }
Example #10
0
        /// <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()
        {
            if (area == null)
            {
                GameObject simPlayer = SDK_InputSimulator.FindInScene();
                if (simPlayer)
                {
                    area = simPlayer.transform;
                }
            }

            return(area);
        }
Example #11
0
        /// <summary>
        /// The GetControllerModel method returns the model alias for the given controller hand.
        /// </summary>
        /// <param name="hand">The hand enum of which controller model to retrieve.</param>
        /// <returns>The GameObject that has the model alias within it.</returns>
        public override GameObject GetControllerModel(ControllerHand hand)
        {
            GameObject model     = null;
            GameObject simPlayer = SDK_InputSimulator.FindInScene();

            if (simPlayer != null)
            {
                switch (hand)
                {
                case ControllerHand.Left:
                    model = simPlayer.transform.Find(string.Format("{0}/Hand", LEFT_HAND_CONTROLLER_NAME)).gameObject;
                    break;

                case ControllerHand.Right:
                    model = simPlayer.transform.Find(string.Format("{0}/Hand", RIGHT_HAND_CONTROLLER_NAME)).gameObject;
                    break;
                }
            }
            return(model);
        }
Example #12
0
        /// <summary>
        /// The GetControllerModel method returns the model alias for the given controller hand.
        /// </summary>
        /// <param name="hand">The hand enum of which controller model to retrieve.</param>
        /// <returns>The GameObject that has the model alias within it.</returns>
        public override GameObject GetControllerModel(ControllerHand hand)
        {
            GameObject model     = null;
            GameObject simPlayer = SDK_InputSimulator.FindInScene();

            if (simPlayer)
            {
                switch (hand)
                {
                case ControllerHand.Left:
                    model = simPlayer.transform.FindChild("LeftHand/Hand").gameObject;
                    break;

                case ControllerHand.Right:
                    model = simPlayer.transform.FindChild("RightHand/Hand").gameObject;
                    break;
                }
            }
            return(model);
        }
Example #13
0
        // Token: 0x06001303 RID: 4867 RVA: 0x0006AEB0 File Offset: 0x000690B0
        protected virtual GameObject GetActualController(SDK_BaseController.ControllerHand hand)
        {
            GameObject gameObject = SDK_InputSimulator.FindInScene();
            GameObject result     = null;

            if (gameObject != null)
            {
                if (hand != SDK_BaseController.ControllerHand.Left)
                {
                    if (hand == SDK_BaseController.ControllerHand.Right)
                    {
                        result = gameObject.transform.Find("RightHand").gameObject;
                    }
                }
                else
                {
                    result = gameObject.transform.Find("LeftHand").gameObject;
                }
            }
            return(result);
        }
Example #14
0
        // Token: 0x060012EF RID: 4847 RVA: 0x0006AA90 File Offset: 0x00068C90
        public override GameObject GetControllerModel(SDK_BaseController.ControllerHand hand)
        {
            GameObject result     = null;
            GameObject gameObject = SDK_InputSimulator.FindInScene();

            if (gameObject != null)
            {
                if (hand != SDK_BaseController.ControllerHand.Left)
                {
                    if (hand == SDK_BaseController.ControllerHand.Right)
                    {
                        result = gameObject.transform.Find(string.Format("{0}/Hand", "RightHand")).gameObject;
                    }
                }
                else
                {
                    result = gameObject.transform.Find(string.Format("{0}/Hand", "LeftHand")).gameObject;
                }
            }
            return(result);
        }
Example #15
0
        /// <summary>
        /// finds the actual controller for the specified hand (identified by name) and returns it
        /// </summary>
        /// <param name="hand">the for which to find the respective controller gameobject</param>
        /// <returns>the gameobject of the actual controller corresponding to the specified hand</returns>
        protected virtual GameObject GetActualController(ControllerHand hand)
        {
            GameObject simPlayer  = SDK_InputSimulator.FindInScene();
            GameObject controller = null;

            if (simPlayer != null)
            {
                switch (hand)
                {
                case ControllerHand.Right:
                    controller = simPlayer.transform.Find(RIGHT_HAND_CONTROLLER_NAME).gameObject;
                    break;

                case ControllerHand.Left:
                    controller = simPlayer.transform.Find(LEFT_HAND_CONTROLLER_NAME).gameObject;
                    break;

                default:
                    break;
                }
            }

            return(controller);
        }