// 弾を撃つ間隔 public float shotDelay = 3.0f; // Use this for initialization IEnumerator Start () { rb = GetComponent<Rigidbody2D>(); while (true) { shot(); yield return new WaitForSeconds(shotDelay); } } private void shot() { // プレハブ生成 Instantiate(bullet, transform.position, transform.rotation); }