예제 #1
0
    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;

        /*
         * We don't want to end animations while fire buttons is being pressed.
         * This is why we split up the input check and the fire button
         *
         */
        if (Input.GetButton("Fire1"))
        {
            if (canFire())
            {
                Shoot();
                ammoManager.AmmoUsed(ammoType);
                timer = 0;
            }
        }
        else
        {
            DisableAffects();
        }
    }