Ejemplo n.º 1
0
 // Token: 0x06006183 RID: 24963 RVA: 0x002269F0 File Offset: 0x00224DF0
 private void OnEnable()
 {
     if (this.toggle)
     {
         if (VRCInputManager.IsRequired(this.method))
         {
             this.toggle.interactable = false;
             this.toggle.isOn         = true;
         }
         else if (!VRCInputManager.IsSupported(this.method))
         {
             this.toggle.interactable = false;
             this.toggle.isOn         = false;
         }
         else
         {
             this.toggle.interactable = true;
             this.toggle.isOn         = VRCInputManager.IsEnabled(this.method);
         }
     }
     if (this.disable)
     {
         bool active = VRCInputManager.IsEnabled(this.method) && VRCInputManager.IsSupported(this.method);
         foreach (VRCInputManager.InputMethod input in this.disableExclusiveOf)
         {
             if (VRCInputManager.IsSupported(input) && VRCInputManager.IsEnabled(input))
             {
                 active = false;
             }
         }
         this.disable.SetActive(active);
     }
 }
Ejemplo n.º 2
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;
     }
 }
Ejemplo n.º 3
0
    // Token: 0x06006162 RID: 24930 RVA: 0x00226030 File Offset: 0x00224430
    public override bool ShouldActivateModule()
    {
        if (this.disableControllerNavigation)
        {
            return(false);
        }
        if (!base.ShouldActivateModule())
        {
            return(false);
        }
        if (!VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Controller) && !VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Keyboard))
        {
            return(false);
        }
        if (!VRCUiManager.Instance.IsActive())
        {
            return(false);
        }
        bool flag = this.inSubmit.button;

        flag |= this.inCancel.button;
        return(flag | !Mathf.Approximately(this.inAxisHorizontal.axis, 0f));
    }
Ejemplo n.º 4
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;
    }
Ejemplo n.º 5
0
 // Token: 0x06004EC1 RID: 20161 RVA: 0x001A7488 File Offset: 0x001A5888
 public void Update()
 {
     if (!this._inited)
     {
         return;
     }
     if (this._modelAnimator == null)
     {
         return;
     }
     if (this.HandLayerRight < 0 || this._modelAnimator.layerCount < this.HandLayerRight)
     {
         return;
     }
     if (this.HandLayerLeft < 0 || this._modelAnimator.layerCount < this.HandLayerLeft)
     {
         return;
     }
     VRCInputManager.InputMethod inputMethod = VRCInputManager.InputMethod.Count;
     if (VRCInputManager.IsSupported(VRCInputManager.InputMethod.Vive) && VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Vive))
     {
         inputMethod = VRCInputManager.InputMethod.Vive;
     }
     if (VRCInputManager.IsSupported(VRCInputManager.InputMethod.Oculus) && VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Oculus) && (inputMethod != VRCInputManager.InputMethod.Vive || VRCInputManager.LastInputMethod == VRCInputManager.InputMethod.Oculus))
     {
         inputMethod = VRCInputManager.InputMethod.Oculus;
     }
     if (inputMethod == VRCInputManager.InputMethod.Vive || inputMethod == VRCInputManager.InputMethod.Oculus)
     {
         if (this._isLocalPlayer && this._inited)
         {
             int num;
             if (!this._disable && this.ProcessGestureLeftInput(out num, inputMethod))
             {
                 this.HandGestureLeft = num;
                 if (num > 0)
                 {
                     this.LeftLayerWeightGoal = this.MaxLayerWeight;
                 }
                 else
                 {
                     this.LeftLayerWeightGoal = 0f;
                     if (this.LastHandGestureLeft > 0 && this.LastHandGestureLeft < 101)
                     {
                         this.LeftLayerWeight = Mathf.Clamp01((float)this.LastHandGestureLeft / 100f);
                     }
                 }
             }
             else if (this.HandGestureLeft <= 101)
             {
                 this.LeftLayerWeightGoal = 0f;
             }
             if (!this._disable && this.ProcessGestureRightInput(out num, inputMethod))
             {
                 this.HandGestureRight = num;
                 if (num > 0)
                 {
                     this.RightLayerWeightGoal = this.MaxLayerWeight;
                 }
                 else
                 {
                     this.RightLayerWeightGoal = 0f;
                     if (this.LastHandGestureRight > 0 && this.LastHandGestureRight <= 101)
                     {
                         this.RightLayerWeight = Mathf.Clamp01((float)this.LastHandGestureRight / 100f);
                     }
                 }
             }
             else if (this.HandGestureRight <= 101)
             {
                 this.RightLayerWeightGoal = 0f;
             }
             if (this._ik != null)
             {
                 if (this._ik.isGrasping(false))
                 {
                     this._wasHoldingL = true;
                 }
                 else
                 {
                     if (this._wasHoldingL)
                     {
                         this.HandGestureLeft     = 101;
                         this.LeftLayerWeightGoal = this.MaxLayerWeight;
                         this._lettingGoL         = true;
                     }
                     if (this._lettingGoL)
                     {
                         this._letGoWaitL += Time.deltaTime;
                         if (this._letGoWaitL > 1f)
                         {
                             this._wasHoldingL    = false;
                             this._lettingGoL     = false;
                             this._letGoWaitL     = 0f;
                             this.HandGestureLeft = 0;
                         }
                     }
                 }
                 if (this._ik.isGrasping(true))
                 {
                     this._wasHoldingR = true;
                 }
                 else
                 {
                     if (this._wasHoldingR)
                     {
                         this.HandGestureRight     = 101;
                         this.RightLayerWeightGoal = this.MaxLayerWeight;
                         this._lettingGoR          = true;
                     }
                     if (this._lettingGoR)
                     {
                         this._letGoWaitR += Time.deltaTime;
                         if (this._letGoWaitR > 1f)
                         {
                             this._wasHoldingR     = false;
                             this._lettingGoR      = false;
                             this._letGoWaitR      = 0f;
                             this.HandGestureRight = 0;
                         }
                     }
                 }
             }
             if (this._inPieLClick.button || this._inPieRClick.button)
             {
                 this._gestLTimer          = 0f;
                 this._gestRTimer          = 0f;
                 this.HandGestureLeft      = 0;
                 this.HandGestureRight     = 0;
                 this.LeftLayerWeightGoal  = 0f;
                 this.RightLayerWeightGoal = 0f;
             }
             if (this.LeftLayerWeight > 0f || this.RightLayerWeight > 0f)
             {
                 PoseRecorder.poseContents |= 16;
             }
         }
     }
     if (this.LeftLayerWeight != this.LeftLayerWeightGoal)
     {
         this.LeftLayerWeight = Mathf.MoveTowards(this.LeftLayerWeight, this.LeftLayerWeightGoal, Time.deltaTime * 5f);
     }
     if (this.RightLayerWeight != this.RightLayerWeightGoal)
     {
         this.RightLayerWeight = Mathf.MoveTowards(this.RightLayerWeight, this.RightLayerWeightGoal, Time.deltaTime * 5f);
     }
     if (this.HandGestureRight != 255)
     {
         if (this.HandGestureRight > 0 && this.HandGestureRight < 101)
         {
             this._modelAnimator.SetInteger("HandGestureRight", 0);
             this._modelAnimator.SetLayerWeight(this.HandLayerRight, Mathf.Clamp01((float)this.HandGestureRight / 100f));
         }
         else
         {
             this._modelAnimator.SetInteger("HandGestureRight", this.HandGestureRight - 100);
             this._modelAnimator.SetLayerWeight(this.HandLayerRight, Mathf.Clamp01(this.RightLayerWeight));
         }
     }
     if (this.HandGestureLeft != 255)
     {
         if (this.HandGestureLeft > 0 && this.HandGestureLeft < 101)
         {
             this._modelAnimator.SetInteger("HandGestureLeft", 0);
             this._modelAnimator.SetLayerWeight(this.HandLayerLeft, Mathf.Clamp01((float)this.HandGestureLeft / 100f));
         }
         else
         {
             this._modelAnimator.SetInteger("HandGestureLeft", this.HandGestureLeft - 100);
             this._modelAnimator.SetLayerWeight(this.HandLayerLeft, Mathf.Clamp01(this.LeftLayerWeight));
         }
     }
     this.LastHandGestureLeft  = this.HandGestureLeft;
     this.LastHandGestureRight = this.HandGestureRight;
     this.EnableGestureCollision(0, this.LeftLayerWeight > 0.05f && !this._wasHoldingL && !this._lettingGoL);
     this.EnableGestureCollision(1, this.RightLayerWeight > 0.05f && !this._wasHoldingR && !this._lettingGoR);
     if (this._ik != null)
     {
         if (this._ik.isGrasping(false))
         {
             this._wasHoldingL = true;
         }
         if (this._ik.isGrasping(true))
         {
             this._wasHoldingR = true;
         }
     }
 }