コード例 #1
0
        protected virtual void OnEnable()
        {
            hintCanvas     = transform.Find("Canvas/Control Hints").gameObject;
            crossHairPanel = transform.Find("Canvas/CrosshairPanel").gameObject;
            hintText       = hintCanvas.GetComponentInChildren <Text>();
            hintCanvas.SetActive(showControlHints);
            gazeTransform           = transform.Find(SDK_GearVRSimController.GAZE_CONTROLLER_NAME);
            oldPos                  = Input.mousePosition;
            neck                    = transform.Find("Neck");
            gazeController          = gazeTransform.GetComponent <SDK_ControllerGearVRSim>();
            gazeController.selected = true;
            destroyed               = false;

            SDK_GearVRSimController controllerSDK = VRTK_SDK_Bridge.GetControllerSDK() as SDK_GearVRSimController;

            if (controllerSDK != null)
            {
                Dictionary <string, KeyCode> keyMappings = new Dictionary <string, KeyCode>()
                {
                    { "TouchpadPress", touchpadAlias },
                    { "ButtonTwo", backAlias },
                    { "StartMenu", startMenuAlias },
                };
                controllerSDK.SetKeyMappings(keyMappings);
            }
            gazeTransform.gameObject.SetActive(true);
            crossHairPanel.SetActive(false);
        }
コード例 #2
0
 protected virtual void SetupPlayer()
 {
     if (gazeController == null)
     {
         GameObject simPlayer = SDK_InputGearVRSimulator.FindInScene();
         if (simPlayer != null)
         {
             gazeController = (gazeController == null ? simPlayer.transform.Find(GAZE_CONTROLLER_NAME).GetComponent <SDK_ControllerGearVRSim>() : gazeController);
         }
     }
 }