Ejemplo n.º 1
0
 void Update()
 {
     if (idOfWave == 6)
     {
         levelWin.WinGame();
     }
     if (curentTimeOfWave <= wavesScriptableObjects[idOfWave].TimeOfWaves)
     {
         curentTimeOfWave += Time.deltaTime;
         if (cooldown >= wavesScriptableObjects[idOfWave].TimeBeetweenSpaunOfMob)
         {
             Instantiate(enemyPrefab, spawnPoint.transform.position, Quaternion.identity);
             cooldown = 0;
         }
         else
         {
             cooldown += Time.deltaTime;
         }
     }
     else
     {
         idOfWave++;
         curentTimeOfWave = 0;
     }
 }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (count == 15)
     {
         winMenu.WinGame();
         winSound.SetActive(true);
     }
 }
Ejemplo n.º 3
0
 void Die()
 {
     hurtSound.SetActive(true);
     explosionParticle.SetActive(true);
     EnemiesAlive--;
     Invoke("Wait", 1);
     if (EnemiesAlive <= 0)
     {
         winSound.SetActive(true);
         winMenu.WinGame();
     }
     Destroy(gameObject);
 }