コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            leftHand.InputExtendHand();
        }

        if (Input.GetMouseButtonDown(1))
        {
            rightHand.InputExtendHand();
        }

        if (Input.GetMouseButtonUp(0))
        {
            leftHand.InputDropHand();
            GraspManager.Instance.ClearObjectInHands();
        }

        if (Input.GetMouseButtonUp(1))
        {
            rightHand.InputDropHand();
            GraspManager.Instance.ClearObjectInHands();
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            GraspManager.Instance.EvaluateGrasp();
        }

        if (Input.GetKeyDown(KeyCode.LeftControl))
        {
            if (isFalling || isStandingUp)
            {
                return;
            }

            isCrouching = true;
            crouchingController.InputCrouch();
            rightHand.CheckCrouching();
            leftHand.CheckCrouching();
        }

        if (Input.GetKeyUp(KeyCode.LeftControl))
        {
            if (isFalling || isStandingUp)
            {
                return;
            }

            isCrouching = false;
            crouchingController.InputStandUp();
            rightHand.CheckCrouching();
            leftHand.CheckCrouching();
        }
    }