// Update is called once per frame
    void Update()
    {
        horizontalMove = Input.GetAxisRaw("Horizontal") * moveSpeed;
        jump           = Input.GetKeyDown(KeyCode.Space);
        Up             = Input.GetKey(KeyCode.UpArrow);


        if (Input.GetKey(KeyCode.LeftControl) && shoot)
        {
            Debug.Log(Up);
            controller.shoot(Up, false);
            StartCoroutine(fireRate());
        }
    }
Esempio n. 2
0
    void FixedUpdate()
    {
        // Move the character
        controller.move(horizontalMove, jump, upPress, downShot);

        if (fire)
        {
            if (chargedCur >= chargedDelay)
            {
                chargedShot = true;
            }


            if (shoot)
            {
                controller.shoot(upPress, downShot, chargedShot);
                chargedCur  = 0;
                chargedShot = false;
                StartCoroutine(fireRate());
            }
        }
    }