//public GameObject bullet; // Start is called before the first frame update IEnumerator Start() { spaceship = GetComponent <CommonSpaceship>(); while (true) { spaceship.Shot(transform); //Instantiate(bullet, transform.position, transform.rotation); yield return(new WaitForSeconds(0.05f)); } }
IEnumerator Start() { spaceship = GetComponent <CommonSpaceship>(); spaceship.Move(transform.up * -1); while (true) { for (int i = 0; i < transform.childCount; i++) { Transform shotPosition = transform.GetChild(i); spaceship.Shot(shotPosition); } yield return(new WaitForSeconds(spaceship.shotDelay)); } }