private void CheckForFire1Input() { if (Input.GetButtonDown("Fire1")) { spaceship.FirePrimaryWeapon(); } }
private IEnumerator ShootPlayer() { shooting = true; RandomizeTarget(); do { lastRotation = transform.rotation; spaceship.LookAtTarget(transform, randomizedPlayerTarget); yield return(new WaitForSeconds(0.01f)); } while (transform.rotation != lastRotation); yield return(new WaitForSeconds(0.05f)); spaceship.FirePrimaryWeapon(); yield return(new WaitForSeconds(fireRate)); shooting = false; }