Пример #1
0
 private void CheckForFire1Input()
 {
     if (Input.GetButtonDown("Fire1"))
     {
         spaceship.FirePrimaryWeapon();
     }
 }
Пример #2
0
    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;
    }