Пример #1
0
    // Update is called once per frame
    void Update()
    {
        horizontalAxis = Input.GetAxis("Horizontal");
        verticalAxis   = Input.GetAxis("Vertical");

        if (Input.GetButton("Reversal") && timeTrigger.CanReverse())
        {
            playerScript.StopVelocity();
            timeTrigger.ReverseTime();
        }
        else
        {
            inputVectorMag = new Vector2(horizontalAxis, verticalAxis).magnitude;
            if (inputVectorMag > leftDeadzone)
            {
                RotateMummy();
                Run();
            }
            else if (characterVelocity.magnitude > 0)
            {
                Walk();
            }
            else
            {
                Idle();
            }
        }

        if (playerScript.JumpStates()[0] && Input.GetButtonDown("Jump"))
        {
            Jump();
        }

        else if (!playerScript.JumpStates()[0] && !playerScript.JumpStates()[2] && Input.GetButtonDown("Jump"))
        {
            Jump();
        }

        rStickInput = new Vector2(Input.GetAxis("HorizontalR"), Input.GetAxis("VerticalR"));

        if (rStickInput.magnitude > rightDeadzone)
        {
            camCon.CameraRotation(rStickInput[0], rStickInput[1]);
        }

        if (Input.GetButtonUp("Reversal"))
        {
            timeTrigger.StopReversal();
        }
    }