void spawnRandomMoles(int count)
    {
        alienController goblin = Instantiate(goblinPrefab);

        goblin.setWhackAMoleController(this);
        allGoblins.Add(goblin);
    }
    IEnumerator commandShoot()
    {
        while (true)
        {
            yield return(new WaitForSeconds(FireDelay));

            aliens.Clear();
            foreach (Transform child in transform)
            {
                aliens.Add(child.gameObject);
            }
            if (aliens.Count > 0)
            {
                int             i       = Random.Range(0, aliens.Count);
                alienController shooter = aliens [i].GetComponent <alienController> ();
                shooter.shoot();
            }
        }
    }
示例#3
0
    void spawnRandomMoles(int count)
    {
        alienController alien = Instantiate(alienPrefab, this.transform);

        allAliens.Add(alien);
    }
 public void setCurrentAlien(alienController aC)
 {
     currentAlien = aC;
 }