Ejemplo n.º 1
0
    void Update()
    {
        if (Input.GetKey(attack_weak))
        {
            movementController.Attack(true);
        }
        if (Input.GetKey(attack_large))
        {
            movementController.Attack(false);
        }
        if (Input.GetKeyDown(jump))
        {
            movementController.Jump();
        }
        Vector2 input = Vector2.zero;

        if (Input.GetKey(moveForward))
        {
            input.y = 1;
        }
        else if (Input.GetKey(moveBack))
        {
            input.y = -1;
        }

        if (Input.GetKey(moveLeft))
        {
            input.x = -1;
        }
        else if (Input.GetKey(moveRight))
        {
            input.x = 1;
        }
        movementController.Move(input, Input.GetKey(acceleration));
    }