Enemy Spawner

What code do I need to add so it repeats this every x seconds. Thanks in advance

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GenerateEnemy : MonoBehaviour
{
    public GameObject theEnemy;
    public int xPos;
    public int zPos;
    public int enemyCount;
  
    void Start()
    {
        StartCoroutine(EnemyDrop());
    }
    IEnumerator EnemyDrop()
    {
        while (enemyCount < 15)
        {
            xPos = Random.Range(-26, 30);
            zPos = Random.Range(-26, 30);
            Instantiate(theEnemy, new Vector3(xPos, 1, zPos), Quaternion.identity);
            yield return new WaitForSeconds(0.1f);
            enemyCount += 1;
        }
    }
}

See how that while loop in your coroutine spawns enemies spaced by 0.1f seconds?

Basically wrap the entire while loop in ANOTHER endless while loop (usually while(true) ).

Inside this new endless while loop, do that existing while loop, and then do a yield return new WaitForSeconds(X); where X is your X seconds.

Sorry but I’m new to programming and I don’t really understand how to do that. If you could tell me our even write out the code it would be graciously appreciated