예제 #1
0
    void Update()
    {
        // Store the input axes.
        h = Input.GetAxis("Horizontal");
        v = Input.GetAxis("Vertical");

        // Set the input axes on the Animator Controller.
        anim.SetFloat(hFloat, h, 0.1f, Time.deltaTime);
        anim.SetFloat(vFloat, v, 0.1f, Time.deltaTime);

        // Toggle sprint by input.
        sprint = Input.GetButton(sprintButton);

        // Set the correct camera FOV for sprint mode.
        if (IsSprinting())
        {
            changedFOV = true;
            camScript.SetFOV(sprintFOV);
        }
        else if (changedFOV)
        {
            camScript.ResetFOV();
            changedFOV = false;
        }

        // Set the grounded test on the Animator Controller.
        anim.SetBool(groundedBool, IsGrounded());
    }
예제 #2
0
    void Update()
    {
        // Store the input axes.
        h = actor.playerController.actorBindings.MoveAxes.X;
        v = actor.playerController.actorBindings.MoveAxes.Y;

        // Set the input axes on the Animator Controller.
        anim.SetFloat(hID, h, 0.1f, Time.deltaTime);
        anim.SetFloat(vID, v, 0.1f, Time.deltaTime);

        // Toggle sprint by input.
        sprint = Input.GetButton(sprintButton);

        // Set the correct camera FOV for sprint mode.
        if (IsSprinting())
        {
            changedFOV = true;
            camScript.SetFOV(sprintFOV);
        }
        else if (changedFOV)
        {
            camScript.ResetFOV();
            changedFOV = false;
        }
        // Set the grounded test on the Animator Controller.
        anim.SetBool(groundedBool, IsGrounded());
    }
    void Update()
    {
        if (!this.IsActive)
        {
            this.h = 0;
            this.v = 0;
        }

        // Store the input axes.
        h = Input.GetAxis("Horizontal");
        v = Input.GetAxis("Vertical");

        // Set the input axes on the Animator Controller.
        anim.SetFloat(hFloat, h);
        anim.SetFloat(vFloat, v);

        // Toggle sprint by input.
        sprint = Input.GetButton("Sprint");

        // Set the correct camera FOV.
        if (isSprinting())
        {
            camScript.SetFOV(sprintFOV);
        }
        else
        {
            camScript.ResetFOV();
        }
    }
    void Update()
    {
        //Assign joysticks to variables on canvas
        var horizontalOne = joystickOne.Horizontal;
        var verticalOne   = joystickOne.Vertical;
        var horizontalTwo = joystickTwo.Horizontal;
        var verticalTwo   = joystickTwo.Vertical;

        // Store the input axes.
        h = joystickOne.Horizontal;
        v = joystickOne.Vertical;

        // Set the input axes on the Animator Controller.
        anim.SetFloat(hFloat, h, 0.1f, Time.deltaTime);
        anim.SetFloat(vFloat, v, 0.1f, Time.deltaTime);

        // Toggle sprint by input.
        sprint = Input.GetButton(sprintButton);

        // Set the correct camera FOV for sprint mode.
        if (IsSprinting())
        {
            changedFOV = true;
            camScript.SetFOV(sprintFOV);
        }
        else if (changedFOV)
        {
            camScript.ResetFOV();
            changedFOV = false;
        }
        // Set the grounded test on the Animator Controller.
        anim.SetBool(groundedBool, IsGrounded());
    }
    void Update()
    {
        // Store the input axes.
        h = GameManager.Instance.InputController.GetAxis("Horizontal");
        v = GameManager.Instance.InputController.GetAxis("Vertical");

        // Set the input axes on the Animator Controller.
        anim.SetFloat(hFloat, h);
        anim.SetFloat(vFloat, v);

        // Toggle sprint by input.
        sprint = GameManager.Instance.InputController.GetButton("Sprint");

        // Set the correct camera FOV.
        if (isSprinting())
        {
            camScript.SetFOV(sprintFOV);
        }
        else
        {
            camScript.ResetFOV();
        }
    }
예제 #6
0
    private void Update()
    {
        h = Input.GetAxis("Horizontal");
        v = Input.GetAxis("Vertical");

        playerAnimator.SetFloat(hFloat, h, 0.1f, Time.deltaTime);
        playerAnimator.SetFloat(vFloat, v, 0.1f, Time.deltaTime);

        isSprint = Input.GetButton(ButtonName.Sprint);
        if (IsSprinting())
        {
            isChangedFOV = true;
            camScript.SetFOV(sprintFOV);
        }
        else
        if (isChangedFOV == true)
        {
            camScript.ResetFOV();
            isChangedFOV = false;
        }

        playerAnimator.SetBool(groundedBool, IsGrounded());
    }