Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Time.time > nextEnemy && GameObject.FindGameObjectsWithTag("Enemy").Length < data.GetEnemyLimit() && active.SpawnOrNot())
     {
         closest   = GetClosestSpawnpointsToPlayer();
         nextEnemy = Time.time + spawnTime;
         int randomValue = Random.Range(0, 3);
         Debug.Log(randomValue);
         Instantiate(enemy, closest[randomValue].position, closest[randomValue].rotation);
     }
 }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (Time.time > nextEnemy && GameObject.FindGameObjectsWithTag("Enemy").Length < data.GetEnemyLimit() && active.SpawnOrNot())
     {
         closest   = GetClosestSpawnpointToPlayer();
         nextEnemy = Time.time + spawnTime;
         Instantiate(enemy, closest.position, closest.rotation);
     }
 }