Exemplo n.º 1
0
    void SpawnEnemy()
    {
        string randomKey = keyList[random.Next(keyList.Count)];

        currentPool = spawnDictionary[randomKey];
        GameObject obj = currentPool.GetObject();

        obj.transform.position = GetRandomSpawnPoint();
        obj.transform.up       = Vector3.zero - obj.transform.position;

        enemiesOnScreen++;

        if (obj.CompareTag("KillableEnemy"))
        {
            killableEnemiesOnScreen++;
            HelperMethods.AddEdibleBug(obj.transform);
        }

        if (currentPool.spawnTotal == 0)
        {
            keyList.Remove(randomKey);
        }
    }
Exemplo n.º 2
0
 void Start()
 {
     HelperMethods.AddEdibleBug(transform);
 }