Inheritance: MonoBehaviour
Example #1
0
 override protected void Init()
 {
     base.Init();
     minionSpawner = GetComponent <MinionSpawner>();
     if (minionSpawner == null)
     {
         throw new Exception("You must add and setup MinionSpawner in order to Barracks to work");
     }
 }
Example #2
0
    public static MinionSpawner Get()
    {
        if (!inst)
        {
            inst = (MinionSpawner)FindObjectOfType(typeof(MinionSpawner));

            if (inst)
            {
                //Debug.Log("Es darf nur eine instanz dieser klasse live sein!");
            }
        }
        return(inst);
    }
Example #3
0
    void StartWave()
    {
        audioController.PlayClip(AudioController.BossSFX.whistleBlow);
        print("WHISTLE BLOW!: Round #" + (currentRound + 1) + "     Wave #" + (currentWave + 1));
        waveStarted = true;

        //Get an array of all of the spawners in the scene.
        GameObject[]    spawnerObjects = GameObject.FindGameObjectsWithTag("Minion Spawner");
        MinionSpawner[] spawners       = new MinionSpawner[spawnerObjects.Length];
        for (int i = 0; i < spawnerObjects.Length; ++i)
        {
            spawners[i] = spawnerObjects[i].GetComponent <MinionSpawner>();
            //If the spawner is not supposed to be run this round, skip to the next available spawner.
            if (spawners[i].roundActive != (currentRound + 1))
            {
                continue;
            }

            spawners[i].SpawnMinions();
            currentEnemyCount += spawners[i].GetEnemyCount();
        }
    }
Example #4
0
    private void SpawnPowerUp(PowerUpType type)
    {
        MinionSpawner ms = GameObject.Find("MinionSpawner").GetComponent <MinionSpawner>();

        switch (type)
        {
        case PowerUpType.BOOST_MINION_HEALTH:
            HealthPowerUp P1 = Instantiate(healthPU).GetComponent <HealthPowerUp>();
            P1.target             = ms;
            P1.transform.position = this.transform.position;
            break;

        case PowerUpType.BOOST_MINION_SPAWN:
            MinionSpawnPowerUp P2 = Instantiate(spawnPU).GetComponent <MinionSpawnPowerUp>();
            P2.target             = ms;
            P2.transform.position = this.transform.position;
            break;

        case PowerUpType.BOOST_MINION_ATK_SPEED:
            GameObject P3 = Instantiate(AtkSpeedPU);
            P3.transform.position = this.transform.position;
            break;
        }
    }
 // Use this for initialization
 void Start()
 {
     m_spawner   = gameObject.GetComponentInChildren <MinionSpawner>();
     m_nextSpawn = Time.time + Random.Range(2f, 5f);
 }
Example #6
0
 public static MinionSpawner getInstance()
 {
     if(instance == null)
         instance = (MinionSpawner)FindObjectOfType(typeof(MinionSpawner));
     return instance;
 }
Example #7
0
 // Use this for initialization
 void Start()
 {
     minion = playerInhibitorTop.GetComponent <MinionSpawner>();
 }