public void SaveEncounter(EnemyEncounterHolder enemyHolder) { for (int index = 0; index < enemyHolder.enemies.Length; index++) { enemiesEncountered[index] = enemyHolder.enemies[index]; enemiesEncounteredLevel[index] = enemyHolder.enemyLevel[index]; } }
public void SpawnEnemy(int index) { int enemyIndex = Random.Range(0, spawnPoints[index].possibleEnemiesPrefab.Length); MapEnemyMovement clone = Instantiate(spawnPoints[index].possibleEnemiesPrefab[enemyIndex], spawnPoints[index].transform).GetComponent <MapEnemyMovement>(); EnemyEncounterHolder enemyEncounterScript = clone.GetComponent <EnemyEncounterHolder>(); clone.enemyIndex = index; enemyEncounterScript.GenerateEnemies(spawnPoints[index]); pauseMenu.AddEnemyMovementScript(ref clone); }