예제 #1
0
 // Token: 0x060062B0 RID: 25264 RVA: 0x00232CA0 File Offset: 0x002310A0
 private void UpdateActiveCursorSet()
 {
     if (this.activeCursor == VRCUiCursorManager.CursorType.None)
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Gaze;
         if (VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Vive) && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Vive))
         {
             this.activeCursor = VRCUiCursorManager.CursorType.Hands;
         }
         if (VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Hydra) && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Hydra))
         {
             this.activeCursor = VRCUiCursorManager.CursorType.Hands;
         }
         if (VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Oculus) && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Oculus))
         {
             this.activeCursor = VRCUiCursorManager.CursorType.Hands;
         }
     }
     if (VRCInputManager.AnyKey(VRCInputManager.InputMethod.Hydra) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Vive) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Oculus))
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Hands;
     }
     else if ((VRCInputManager.AnyKey(VRCInputManager.InputMethod.Controller) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Keyboard)) && HMDManager.IsHmdDetected())
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Gaze;
     }
     else if (VRCInputManager.AnyKey(VRCInputManager.InputMethod.Mouse))
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Mouse;
     }
 }
예제 #2
0
    // Token: 0x06006005 RID: 24581 RVA: 0x0021C9C4 File Offset: 0x0021ADC4
    private void SetupControlModeTip()
    {
        bool flag = false;

        if (!VRCInputManager.talkToggle && !VRCInputManager.talkDefaultOn)
        {
            flag = true;
        }
        if (VRCInputManager.showTooltips && flag)
        {
            if (VRCTrackingManager.IsInVRMode())
            {
                this.controllerMode = 0;
            }
            else if (VRCInputManager.IsPresent(VRCInputManager.InputMethod.Keyboard) && VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Keyboard))
            {
                this.controllerMode = 2;
            }
            switch (this.controllerMode)
            {
            case 0:
                break;

            case 1:
                this.xboxTip.SetActive(true);
                this.tipActive = true;
                break;

            case 2:
                this.keybdTip.SetActive(true);
                this.tipActive = true;
                break;

            default:
                Debug.LogError("HudVoiceIndicator: Unknown control method=" + this.controllerMode);
                break;
            }
        }
        this.controlModeChecked = true;
    }
예제 #3
0
    // Token: 0x06005678 RID: 22136 RVA: 0x001DC650 File Offset: 0x001DAA50
    private void Update()
    {
        if (OVRManager.instance != null)
        {
            OVRManager.instance.enabled = (VRSettings.enabled && this.IsInVRMode());
        }
        if (this.TrackerAnchor != null)
        {
            if (OVRManager.instance != null && OVRManager.instance.enabled)
            {
                if (!this.TrackerAnchor.gameObject.activeSelf)
                {
                    this.TrackerAnchor.gameObject.SetActive(true);
                }
                OVRPose pose = OVRManager.tracker.GetPose(0);
                this.TrackerAnchor.localPosition = pose.position;
                this.TrackerAnchor.localRotation = pose.orientation;
            }
            else if (this.TrackerAnchor.gameObject.activeSelf)
            {
                this.TrackerAnchor.gameObject.SetActive(false);
            }
        }
        bool flag = OVRManager.instance != null && OVRManager.instance.enabled && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Oculus);

        OVRInput.Controller controller = OVRInput.GetConnectedControllers() & OVRInput.GetActiveController();
        bool flag2 = VRCInputManager.LastInputMethod == VRCInputManager.InputMethod.Oculus;

        if (flag2)
        {
            this._areControllersAsleep = false;
            this._usingHandControllers = true;
        }
        else if (!this._areControllersAsleep)
        {
            if (this._usingHandControllers)
            {
                this._usingHandControllers        = false;
                this._controllerSleepTimeoutStart = Time.unscaledTime;
            }
            if (Time.unscaledTime - this._controllerSleepTimeoutStart > 1f)
            {
                this._areControllersAsleep = true;
                VRCTrackingManager.OnHandControllerAsleep();
            }
        }
        if (this.LeftHandAnchor != null)
        {
            if (flag && (controller & OVRInput.Controller.LTouch) != OVRInput.Controller.None && !this._areControllersAsleep)
            {
                if (!this.LeftHandAnchor.gameObject.activeSelf)
                {
                    this.LeftHandAnchor.gameObject.SetActive(true);
                }
                this.LeftHandAnchor.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.LTouch);
                this.LeftHandAnchor.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.LTouch);
            }
            else if (this.LeftHandAnchor.gameObject.activeSelf)
            {
                this.LeftHandAnchor.gameObject.SetActive(false);
            }
        }
        if (this.RightHandAnchor != null)
        {
            if (flag && (controller & OVRInput.Controller.RTouch) != OVRInput.Controller.None && !this._areControllersAsleep)
            {
                if (!this.RightHandAnchor.gameObject.activeSelf)
                {
                    this.RightHandAnchor.gameObject.SetActive(true);
                }
                this.RightHandAnchor.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.RTouch);
                this.RightHandAnchor.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.RTouch);
            }
            else if (this.RightHandAnchor.gameObject.activeSelf)
            {
                this.RightHandAnchor.gameObject.SetActive(false);
            }
        }
    }