Ejemplo n.º 1
0
    private void TryInput(HandInteractionController thisController, SteamVR_Behaviour_Pose thisPose)
    {
        ////premo e mollo il grip
        //if (gripAction.GetStateDown(thisPose.inputSource))
        //{
        //    thisController.HandActivated(true);
        //    return;
        //}

        //if (gripAction.GetStateUp(thisPose.inputSource))
        //{
        //    thisController.HandReleased(true);
        //    return;
        //}



        //premo e mollo il trigger
        if (pullAction.GetStateDown(thisPose.inputSource))
        {
            var isGripPressed = gripAction.GetStateDown(thisPose.inputSource);
            thisController.HandActivated(isGripPressed);
            return;
        }

        if (pullAction.GetStateUp(thisPose.inputSource))
        {
            thisController.HandReleased(false);
            return;
        }
    }
Ejemplo n.º 2
0
    private void Start()
    {
        controllerR = handR.GetComponent <HandInteractionController>();
        poseR       = handR.GetComponent <SteamVR_Behaviour_Pose>();

        controllerL = handL.GetComponent <HandInteractionController>();
        poseL       = handL.GetComponent <SteamVR_Behaviour_Pose>();

        cameraRig = SteamVR_Render.Top().origin;
        head      = SteamVR_Render.Top().head;

        characterControllerMover = new CharacterControllerMover(charController, cameraRig, head, 0.1f, 0.2f);
    }