Ejemplo n.º 1
0
 void SpawnEntity()
 {
     if (spawnQueue.Count > 0)
     {
         SpawnableEntity next = SpawnManager.instance.Search(spawnQueue.Dequeue());
         next.Create(transform.position, Quaternion.identity);
     }
     else
     {
         Debug.LogWarning("Empty Queue");
     }
 }
Ejemplo n.º 2
0
    void SpawnEntity()
    {
        if (spawnQueue.Count > 0)
        {
            SpawnableEntity next = SpawnManager.instance.Search(spawnQueue.Dequeue());
            next.Create(transform.position, Quaternion.identity);
            variantTimer += currentDelta;
            spawnDelay    = variantTimer;

            if (spawnQueue.Count <= 0 && spawnWaves.Count > 0)
            {
                FillQueue();
            }
        }
        else
        {
            Debug.LogWarning("No more waves");
        }
    }