private void Fire() { if (projectileMG.AbleToShoot()) { lastFireTime = Time.time; } lastFireTime = Time.time; realTimeBeforeNextFireTime = Random.Range(minTimeBeforeNextFireTime, maxTimeBeforeNextFireTime); }
private void Fire() { if (Input.GetButton("Fire1") && timeToFire < Time.time) { if (projectileMG.AbleToShoot()) { AudioManager.instance.Play("Shoot"); } projectileMG.Shoot(); timeToFire = Time.time + 1 / fireRate; } }
private void Fire() { if (Input.GetButton(fireAxitName)) { if (Time.time - lastFireTime >= 1.0f / fireRate) { if (projectileMG.AbleToShoot()) { lastFireTime = Time.time; } } } }