// Update is called once per frame void FixedUpdate() { spawnLocation = new Vector3(Random.Range(-20.0f, 20.0f), 10, Random.Range(-15.0f, 15.0f)); pooler.SpawnFromPool("Slime", spawnLocation); spawnLocation = new Vector3(Random.Range(-20.0f, 20.0f), 10, Random.Range(-15.0f, 15.0f)); pooler.SpawnFromPool("Azulito", spawnLocation); }
public GameObject CallingSpawnEnemy(EnemyType type) { Vector3 position = getRandomSpawnPosition(); EnemyPooler pool = EnemyPooler.Instance; return(pool.SpawnFromPool(type, position)); }
private void OnTriggerEnter2D(Collider2D col) { if (col.CompareTag("Player")) { if (numberSpawnedEnemy1 <= 2) { enemyPooler.SpawnFromPool("Enemy", spawnPoint.position, Quaternion.identity); numberSpawnedEnemy1++; } specialEnemyCountDown++; if (specialEnemyCountDown == 5) { if (numberSpawnedEnemy2 < 1) { enemyPooler.SpawnFromPool("Enemy2", spawnPoint.position, Quaternion.identity); numberSpawnedEnemy2++; } } } }
private void spawnMob() { int alive = 0; foreach (GameObject enemy in GameObject.FindGameObjectsWithTag("Enemy")) { alive++; } if (GameObject.FindGameObjectWithTag("Spawner").GetComponentInParent <EnemyPooler>().getSize() >= alive) { enemyPooler.SpawnFromPool("Enemy"); } }
public void SpawnEnemy() { LevelManager manager = LevelManager.Instance; EnemyPooler pool = EnemyPooler.Instance; foreach (EnemyAmount eAmount in _enemyAmounts) { for (int i = 0; i < eAmount.Amount; i++) { Vector3 position = manager.getRandomSpawnPosition(); pool.SpawnFromPool(eAmount.Type, position); } } gameObject.SetActive(false); }
private void FixedUpdate() { enemyPool.SpawnFromPool("Enemy", transform.position, Quaternion.identity); }