Ejemplo n.º 1
0
 // Token: 0x0600566C RID: 22124 RVA: 0x001DBD84 File Offset: 0x001DA184
 public override void ConnectInputs(Dictionary <string, VRCInput> inputs)
 {
     this.inVertical           = inputs["Vertical"];
     this.inHorizontal         = inputs["Horizontal"];
     this.inLookHorizontal     = inputs["LookHorizontal"];
     this.inLookVertical       = inputs["LookVertical"];
     this.inJump               = inputs["Jump"];
     this.inRun                = inputs["Run"];
     this.inBack               = inputs["Back"];
     this.inMenu               = inputs["Menu"];
     this.inComfortLeft        = inputs["ComfortLeft"];
     this.inComfortRight       = inputs["ComfortRight"];
     this.inGrabRight          = inputs["GrabRight"];
     this.inUseRight           = inputs["UseRight"];
     this.inGrabLeft           = inputs["GrabLeft"];
     this.inUseLeft            = inputs["UseLeft"];
     this.inTouchpadLeftClick  = inputs["TouchpadLeftClick"];
     this.inTouchpadLeftX      = inputs["TouchpadLeftX"];
     this.inTouchpadLeftY      = inputs["TouchpadLeftY"];
     this.inTouchpadRightClick = inputs["TouchpadRightClick"];
     this.inTouchpadRightX     = inputs["TouchpadRightX"];
     this.inTouchpadRightY     = inputs["TouchpadRightY"];
     this.inUseAxisLeft        = inputs["UseAxisLeft"];
     this.inUseAxisRight       = inputs["UseAxisRight"];
     this.inGrabAxisLeft       = inputs["GrabAxisLeft"];
     this.inGrabAxisRight      = inputs["GrabAxisRight"];
     this._inFaceTouchL        = VRCInputManager.FindInput("FaceTouchLeft");
     this._inFaceTouchR        = VRCInputManager.FindInput("FaceTouchRight");
     this._inFaceButtonTouchL  = VRCInputManager.FindInput("FaceButtonTouchLeft");
     this._inFaceButtonTouchR  = VRCInputManager.FindInput("FaceButtonTouchRight");
     this._inTriggerTouchL     = VRCInputManager.FindInput("TriggerTouchLeft");
     this._inTriggerTouchR     = VRCInputManager.FindInput("TriggerTouchRight");
     this._inThumbRestTouchL   = VRCInputManager.FindInput("ThumbRestTouchLeft");
     this._inThumbRestTouchR   = VRCInputManager.FindInput("ThumbRestTouchRight");
 }
Ejemplo n.º 2
0
 // Token: 0x06004EC0 RID: 20160 RVA: 0x001A72F4 File Offset: 0x001A56F4
 private void Awake()
 {
     this._inPieLClick          = VRCInputManager.FindInput("TouchpadLeftClick");
     this._inPieLX              = VRCInputManager.FindInput("TouchpadLeftX");
     this._inPieLY              = VRCInputManager.FindInput("TouchpadLeftY");
     this._inPieRClick          = VRCInputManager.FindInput("TouchpadRightClick");
     this._inPieRX              = VRCInputManager.FindInput("TouchpadRightX");
     this._inPieRY              = VRCInputManager.FindInput("TouchpadRightY");
     this._inUseL               = VRCInputManager.FindInput("UseLeft");
     this._inUseR               = VRCInputManager.FindInput("UseRight");
     this._inDropL              = VRCInputManager.FindInput("DropLeft");
     this._inDropR              = VRCInputManager.FindInput("DropRight");
     this._inGrabL              = VRCInputManager.FindInput("GrabAxisLeft");
     this._inGrabR              = VRCInputManager.FindInput("GrabAxisRight");
     this._inTriggerL           = VRCInputManager.FindInput("UseAxisLeft");
     this._inTriggerR           = VRCInputManager.FindInput("UseAxisRight");
     this._inFaceTouchL         = VRCInputManager.FindInput("FaceTouchLeft");
     this._inFaceTouchR         = VRCInputManager.FindInput("FaceTouchRight");
     this._inFaceButtonTouchL   = VRCInputManager.FindInput("FaceButtonTouchLeft");
     this._inFaceButtonTouchR   = VRCInputManager.FindInput("FaceButtonTouchRight");
     this._inTriggerTouchL      = VRCInputManager.FindInput("TriggerTouchLeft");
     this._inTriggerTouchR      = VRCInputManager.FindInput("TriggerTouchRight");
     this._inThumbRestTouchL    = VRCInputManager.FindInput("ThumbRestTouchLeft");
     this._inThumbRestTouchR    = VRCInputManager.FindInput("ThumbRestTouchRight");
     this._gestLTimer           = 0f;
     this._gestRTimer           = 0f;
     this.gestureCollisionLayer = LayerMask.NameToLayer("PickupNoEnvironment");
 }
Ejemplo n.º 3
0
 // Token: 0x06005FFC RID: 24572 RVA: 0x0021C438 File Offset: 0x0021A838
 private void Awake()
 {
     this.root     = base.transform.Find("Gestures").gameObject;
     this.piebase  = this.root.transform.Find("Pie").GetComponent <Image>();
     this.icons    = new Image[7];
     this.icons[0] = this.root.transform.Find("fist").GetComponent <Image>();
     this.icons[1] = this.root.transform.Find("point").GetComponent <Image>();
     this.icons[2] = this.root.transform.Find("peace").GetComponent <Image>();
     this.icons[3] = this.root.transform.Find("rocknroll").GetComponent <Image>();
     this.icons[4] = this.root.transform.Find("palm").GetComponent <Image>();
     this.icons[5] = this.root.transform.Find("gun").GetComponent <Image>();
     this.icons[6] = this.root.transform.Find("thumb").GetComponent <Image>();
     if (this.rightHand)
     {
         this._inputX          = VRCInputManager.FindInput("PieMenuRightX");
         this._inputY          = VRCInputManager.FindInput("PieMenuRightY");
         this._gestureSelect   = VRCInputManager.FindInput("PieMenuRightShow");
         this._gestureActivate = VRCInputManager.FindInput("PieMenuRightActivate");
     }
     else
     {
         this._inputX          = VRCInputManager.FindInput("PieMenuLeftX");
         this._inputY          = VRCInputManager.FindInput("PieMenuLeftY");
         this._gestureSelect   = VRCInputManager.FindInput("PieMenuLeftShow");
         this._gestureActivate = VRCInputManager.FindInput("PieMenuLeftActivate");
     }
     this.SelectItem(0);
     this.root.SetActive(false);
 }
Ejemplo n.º 4
0
 // Token: 0x060051CD RID: 20941 RVA: 0x001C0680 File Offset: 0x001BEA80
 private void Awake()
 {
     this.inUseLeft   = VRCInputManager.FindInput("UseLeft");
     this.inUseRight  = VRCInputManager.FindInput("UseRight");
     this.inGrabLeft  = VRCInputManager.FindInput("GrabLeft");
     this.inGrabRight = VRCInputManager.FindInput("GrabRight");
 }
Ejemplo n.º 5
0
 // Token: 0x0600615E RID: 24926 RVA: 0x00225FB4 File Offset: 0x002243B4
 protected override void Start()
 {
     base.Start();
     this.inAxisHorizontal = VRCInputManager.FindInput("Horizontal");
     this.inAxisVertical   = VRCInputManager.FindInput("Vertical");
     this.inSubmit         = VRCInputManager.FindInput("Select");
     this.inCancel         = VRCInputManager.FindInput("Back");
 }
Ejemplo n.º 6
0
 // Token: 0x06006004 RID: 24580 RVA: 0x0021C924 File Offset: 0x0021AD24
 private void Start()
 {
     this.dotImage         = base.transform.Find("VoiceDot").GetComponent <Image>();
     this.dotDisabledImage = base.transform.Find("VoiceDotDisabled").GetComponent <Image>();
     this.dotColor         = this.dotImage.color;
     this.keybdTip         = base.transform.Find("PushToTalkKeybd").gameObject;
     this.xboxTip          = base.transform.Find("PushToTalkXbox").gameObject;
     this.DisableTips();
     this.inVoice = VRCInputManager.FindInput("Voice");
 }
Ejemplo n.º 7
0
 // Token: 0x06004CD3 RID: 19667 RVA: 0x0019BE68 File Offset: 0x0019A268
 private void Start()
 {
     if (DefaultTalkController.Instance == null)
     {
         DefaultTalkController.Instance = this;
     }
     else
     {
         Debug.LogError("More than one DefaultTalkControllers exist! Destroying this one.");
         UnityEngine.Object.Destroy(this);
     }
     this.ToggleMode = ((!VRCInputManager.talkToggle) ? 0 : 1);
     this.inVoice    = VRCInputManager.FindInput("Voice");
 }
Ejemplo n.º 8
0
 // Token: 0x060053F0 RID: 21488 RVA: 0x001CFA50 File Offset: 0x001CDE50
 private void Start()
 {
     this.controller = base.GetComponent <LocomotionInputController>();
     if (this.controller == null || !this.controller.enabled)
     {
         base.enabled = false;
     }
     this.motion = base.GetComponent <VRCMotionState>();
     if (this.motion == null)
     {
         base.enabled = false;
     }
     this.inJump = VRCInputManager.FindInput("Jump");
 }
Ejemplo n.º 9
0
 // Token: 0x060051B3 RID: 20915 RVA: 0x001BF110 File Offset: 0x001BD510
 protected virtual void Awake()
 {
     this.motionState          = base.GetComponent <VRCMotionState>();
     this.headCamMouseRotator  = VRCVrCamera.GetInstance().GetComponentInChildren <NeckMouseRotator>();
     this.inAxisHorizontal     = VRCInputManager.FindInput("Horizontal");
     this.inAxisVertical       = VRCInputManager.FindInput("Vertical");
     this.inComfortLeft        = VRCInputManager.FindInput("ComfortLeft");
     this.inComfortRight       = VRCInputManager.FindInput("ComfortRight");
     this.inAxisLookHorizontal = VRCInputManager.FindInput("LookHorizontal");
     this.inAxisLookVertical   = VRCInputManager.FindInput("LookVertical");
     this.inDrop = VRCInputManager.FindInput("DropRight");
     this.inRun  = VRCInputManager.FindInput("Run");
     InputStateController.lastPosition = VRCTrackingManager.GetWorldTrackingPosition();
     InputStateController.lastRotation = VRCTrackingManager.GetWorldTrackingOrientation();
 }
Ejemplo n.º 10
0
 // Token: 0x06004F17 RID: 20247 RVA: 0x001AA2CC File Offset: 0x001A86CC
 public void Initialize(IkController.IkType ikType, Animator modelAnimator, VRCPlayer player, bool local)
 {
     this._player                  = player;
     this.isLocalPlayer            = local;
     this.animationController      = base.GetComponentInParent <VRC_AnimationController>();
     this._completedUSpeakMove     = false;
     this._reportedUSpeakMoveError = false;
     this._elapsedUSpeakTimeToMove = 0f;
     this._useLimbIK               = false;
     this._useVrcTrackedIk         = false;
     if (modelAnimator != null && modelAnimator.isHuman && modelAnimator.runtimeAnimatorController != null)
     {
         this._modelAnimator = modelAnimator;
         this.SetIkType(ikType, false);
         this._locoLayer = this.GetMatchingLayerIndex(this._modelAnimator, "locomotion");
     }
     else
     {
         this._modelAnimator = null;
         this._locoLayer     = -1;
     }
     if (local)
     {
         this.leftHandGrasper            = this.LeftEffector.gameObject.AddMissingComponent <VRCHandGrasper>();
         this.leftHandGrasper.DropInput  = VRCInputManager.FindInput("DropLeft");
         this.leftHandGrasper.UseInput   = VRCInputManager.FindInput("UseLeft");
         this.leftHandGrasper.GrabInput  = VRCInputManager.FindInput("GrabLeft");
         this.leftHandGrasper.RightHand  = false;
         this.rightHandGrasper           = this.RightEffector.gameObject.AddMissingComponent <VRCHandGrasper>();
         this.rightHandGrasper.DropInput = VRCInputManager.FindInput("DropRight");
         this.rightHandGrasper.UseInput  = VRCInputManager.FindInput("UseRight");
         this.rightHandGrasper.GrabInput = VRCInputManager.FindInput("GrabRight");
         this.rightHandGrasper.RightHand = true;
     }
     this.motion = this.animationController.GetComponentInParent <VRCMotionState>();
     this.motion.StandingHeight = 1f;
     this._inited = true;
     this._completedUSpeakMove = false;
 }
Ejemplo n.º 11
0
 // Token: 0x060062AF RID: 25263 RVA: 0x00232BD4 File Offset: 0x00230FD4
 private void Start()
 {
     if (VRCUiCursorManager.instance != null)
     {
         Debug.LogError("Too Many Cursor Managers.");
     }
     VRCUiCursorManager.instance = this;
     this.uiInteractiveLayers    = LayerMask.GetMask(new string[]
     {
         "UiMenu"
     });
     this.worldInteractiveLayers = (-1 ^ LayerMask.GetMask(new string[]
     {
         "UiMenu",
         "PlayerLocal",
         "UI"
     }));
     this.inDropLeft  = VRCInputManager.FindInput("DropLeft");
     this.inDropRight = VRCInputManager.FindInput("DropRight");
     this.inUseLeft   = VRCInputManager.FindInput("UseLeft");
     this.inUseRight  = VRCInputManager.FindInput("UseRight");
     this.inNavigate  = VRCInputManager.FindInput("Vertical");
 }
Ejemplo n.º 12
0
 // Token: 0x06005261 RID: 21089 RVA: 0x001C4704 File Offset: 0x001C2B04
 private void Start()
 {
     this.inLookHorizontal = VRCInputManager.FindInput("LookHorizontal");
     this.inLookVertical   = VRCInputManager.FindInput("LookVertical");
     this.originalPosition = base.transform.localPosition;
     this.originalRotation = base.transform.localRotation;
     this.originalEulers   = this.originalRotation.eulerAngles;
     if (this.originalEulers.y > 180f)
     {
         this.originalEulers.y = this.originalEulers.y - 360f;
     }
     if (this.originalEulers.x > 180f)
     {
         this.originalEulers.x = this.originalEulers.x - 360f;
     }
     if (this.originalEulers.y < -180f)
     {
         this.originalEulers.y = this.originalEulers.y + 360f;
     }
     if (this.originalEulers.x < -180f)
     {
         this.originalEulers.x = this.originalEulers.x + 360f;
     }
 }
Ejemplo n.º 13
0
 // Token: 0x06005174 RID: 20852 RVA: 0x001BE67A File Offset: 0x001BCA7A
 private void Start()
 {
     this.inReset          = VRCInputManager.FindInput("Reset Orientation");
     this.inToggleSitStand = VRCInputManager.FindInput("ToggleSitStand");
 }
Ejemplo n.º 14
0
 // Token: 0x06005BAB RID: 23467 RVA: 0x002002D9 File Offset: 0x001FE6D9
 private void Start()
 {
     this.vehicle          = base.GetComponentInParent <VehicleController>();
     this.inAxisHorizontal = VRCInputManager.FindInput("Horizontal");
     this.inAxisVertical   = VRCInputManager.FindInput("Vertical");
 }
Ejemplo n.º 15
0
 // Token: 0x06005509 RID: 21769 RVA: 0x001D5138 File Offset: 0x001D3538
 private void Start()
 {
     this.inAxisVertical   = VRCInputManager.FindInput("Vertical");
     this.inAxisHorizontal = VRCInputManager.FindInput("Horizontal");
 }
Ejemplo n.º 16
0
    // Token: 0x060062A6 RID: 25254 RVA: 0x0022F9C8 File Offset: 0x0022DDC8
    public void SetTargetInfo(VRCUiCursor.CursorRaycast target, bool useForUi)
    {
        if (this.inUse == null)
        {
            VRCUiCursor.CursorHandedness cursorHandedness = this.handedness;
            if (cursorHandedness != VRCUiCursor.CursorHandedness.Right)
            {
                if (cursorHandedness == VRCUiCursor.CursorHandedness.Left)
                {
                    this.inUse  = VRCInputManager.FindInput("UseLeft");
                    this.inDrop = VRCInputManager.FindInput("DropLeft");
                }
            }
            else
            {
                this.inUse  = VRCInputManager.FindInput("UseRight");
                this.inDrop = VRCInputManager.FindInput("DropRight");
            }
            if (this.inUse == null)
            {
                return;
            }
        }
        this.over           = target.over;
        this.distance       = target.hitInfo.distance;
        this.targetPosition = target.hitInfo.point;
        bool flag = false;

        if (useForUi)
        {
            if (target.over.Contains(VRCUiCursor.CursorOver.Ui))
            {
                Vector2          screenPos        = new Vector2(0f, 0f);
                UiShapeGenerator uiShapeGenerator = target.uiShape as UiShapeGenerator;
                if (uiShapeGenerator != null)
                {
                    screenPos = uiShapeGenerator.GetPointerPosition(target.hitInfo.textureCoord);
                }
                else
                {
                    screenPos = VRCVrCamera.GetInstance().screenCamera.WorldToScreenPoint(target.hitInfo.point);
                }
                this.uiInput.SetInputState(screenPos, target.hitInfo.point, this.inUse.down, this.inUse.up, this.inDrop.down, this.inDrop.up);
                if (this.uiInput.IsOverSelection())
                {
                    List <VRCUiCursor.CursorOver> list = new List <VRCUiCursor.CursorOver>
                    {
                        VRCUiCursor.CursorOver.UiSelectable
                    };
                    list.AddRange(target.over);
                    target.over = list.ToArray();
                }
                flag = true;
            }
            if (target.over.Contains(VRCUiCursor.CursorOver.Player))
            {
                if (this.inUse.click)
                {
                    this.SelectHoveredPlayer();
                }
                else
                {
                    if (this.hoveredPlayer != null)
                    {
                        PlayerSelector playerSelector = this.hoveredPlayer.playerSelector;
                        playerSelector.Hover(false);
                    }
                    this.hoveredPlayer = target.player;
                    PlayerSelector playerSelector2 = this.hoveredPlayer.playerSelector;
                    if (playerSelector2 != null)
                    {
                        playerSelector2.Hover(true);
                    }
                }
                flag = true;
            }
            else if (this.hoveredPlayer != null)
            {
                PlayerSelector playerSelector3 = this.hoveredPlayer.playerSelector;
                if (playerSelector3 != null)
                {
                    playerSelector3.Hover(false);
                }
                this.hoveredPlayer = null;
            }
            if (target.over.Contains(VRCUiCursor.CursorOver.Web))
            {
                if (this.activeWebView != target.webPanel && this.activeWebView != null)
                {
                    this.activeWebView.HandleFocusLoss();
                }
                this.activeWebView = target.webPanel;
                if (this.activeWebView != null)
                {
                    this.activeWebView.HandleRayHit(target.hitInfo);
                    flag = true;
                }
            }
            else if (this.activeWebView != null)
            {
                this.activeWebView.HandleFocusLoss();
                this.activeWebView = null;
            }
            if (target.over.Length == 0)
            {
                this.uiInput.SetInputState(Vector2.zero, target.hitInfo.point, false, true, false, true);
            }
            VRCUiCursor.CursorHandedness hand = this.handedness;
            if (!flag)
            {
                hand = VRCUiCursor.CursorHandedness.None;
            }
            VRCUiCursorManager.ForceCursorOn(hand);
        }
        VRC_Pickup selectedPickup = null;

        VRC_Interactable[] selectedInteractable = null;
        if (!VRCInputManager.legacyGrasp)
        {
            Component component;
            if (target.interactable == null)
            {
                component = null;
            }
            else
            {
                component = target.interactable.FirstOrDefault((VRC_Interactable i) => i.GetComponent <VRC_UseEvents>() != null || (i.GetComponent <VRC_Trigger>() != null && (i.GetComponent <VRC_Trigger>().HasInteractiveTriggers || i.GetComponent <VRC_Trigger>().HasPickupTriggers)));
            }
            Component component2 = component;
            this.outline.Clone(null);
            if (this.over.Contains(VRCUiCursor.CursorOver.Interactable) && component2 != null)
            {
                Transform trackedTransform = VRCTrackingManager.GetTrackedTransform((this.handedness != VRCUiCursor.CursorHandedness.Left) ? VRCTracking.ID.HandTracker_RightPalm : VRCTracking.ID.HandTracker_LeftPalm);
                bool      flag2            = trackedTransform == null || VRCTrackingManager.IsPointWithinHMDView(trackedTransform.position);
                if (flag2)
                {
                    this.outline.Clone(component2);
                    if (TutorialManager.Instance != null)
                    {
                        TutorialManager.Instance.InteractableSelected(target.interactable, component2, this.handedness == VRCUiCursor.CursorHandedness.Left);
                    }
                    selectedInteractable = target.interactable;
                }
            }
            if (this.over.Contains(VRCUiCursor.CursorOver.Pickup) && target.pickup != null)
            {
                if (target.pickup.currentlyHeldBy == null)
                {
                    this.outline.Clone(target.pickup);
                    if (TutorialManager.Instance != null)
                    {
                        TutorialManager.Instance.PickupSelected(target.pickup, this.handedness == VRCUiCursor.CursorHandedness.Left);
                    }
                    selectedPickup = target.pickup;
                }
                else
                {
                    this.outline.Clone(null);
                }
            }
        }
        else
        {
            this.outline.Clone(null);
        }
        VRCHandGrasper vrchandGrasper = null;

        if (VRCPlayer.Instance != null)
        {
            vrchandGrasper = VRCPlayer.Instance.GetHandGrasper((this.handedness != VRCUiCursor.CursorHandedness.Left) ? ControllerHand.Right : ControllerHand.Left);
        }
        if (vrchandGrasper != null)
        {
            vrchandGrasper.SetSelectedObject(selectedPickup, selectedInteractable);
        }
    }
Ejemplo n.º 17
0
 // Token: 0x06005197 RID: 20887 RVA: 0x001BEFA9 File Offset: 0x001BD3A9
 private void Start()
 {
     this.inMenu = VRCInputManager.FindInput("Select");
 }