예제 #1
0
 // Token: 0x06005619 RID: 22041 RVA: 0x001DA79A File Offset: 0x001D8B9A
 public static void SetEnabled(VRCInputManager.InputMethod input, bool val)
 {
     if (VRCInputManager.inputProcessors.ContainsKey(input))
     {
         VRCInputManager.inputProcessors[input].inputEnabled = val;
     }
 }
예제 #2
0
    // Token: 0x06004EC3 RID: 20163 RVA: 0x001A7BA8 File Offset: 0x001A5FA8
    private bool ProcessGestureLeftInput(out int value, VRCInputManager.InputMethod inputMethod)
    {
        value = 0;
        if (inputMethod != VRCInputManager.InputMethod.Vive)
        {
            value = this.SelectTouchGesture(false);
            if (value != 0)
            {
                this._gestLTimer = 0f;
            }
            return(true);
        }
        if (this._inDropL.button)
        {
            value            = 101;
            this._gestLTimer = 0f;
            return(true);
        }
        float axis = this._inGrabL.axis;

        if (axis > 0.01f)
        {
            value            = Mathf.FloorToInt(axis * 100f);
            this._gestLTimer = 0f;
            return(true);
        }
        Vector2 axis2 = new Vector2(this._inPieLX.axis, this._inPieLY.axis);

        if (axis2.sqrMagnitude > 0f)
        {
            int num = this.DualAxisToPieMenu(false, axis2, 5);
            this._gestLTimer += Time.deltaTime;
            if (this._gestLTimer > 0.1f)
            {
                if (num == 0)
                {
                    value = 90;
                }
                else
                {
                    value = num - 1 + 102;
                }
                return(true);
            }
        }
        else
        {
            this._gestLTimer = 0f;
        }
        return(false);
    }
예제 #3
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;
         }
     }
 }
예제 #4
0
 // Token: 0x06005618 RID: 22040 RVA: 0x001DA775 File Offset: 0x001D8B75
 public static bool AnyKey(VRCInputManager.InputMethod input)
 {
     return(VRCInputManager.inputProcessors.ContainsKey(input) && VRCInputManager.inputProcessors[input].AnyKey());
 }
예제 #5
0
 // Token: 0x06005617 RID: 22039 RVA: 0x001DA750 File Offset: 0x001D8B50
 public static bool IsEnabled(VRCInputManager.InputMethod input)
 {
     return(VRCInputManager.inputProcessors.ContainsKey(input) && VRCInputManager.inputProcessors[input].inputEnabled);
 }
예제 #6
0
 // Token: 0x06005614 RID: 22036 RVA: 0x001DA6E1 File Offset: 0x001D8AE1
 public static bool IsPresent(VRCInputManager.InputMethod input)
 {
     return(VRCInputManager.inputProcessors.ContainsKey(input) && VRCInputManager.inputProcessors[input].present);
 }