コード例 #1
0
 public void SaveEncounter(EnemyEncounterHolder enemyHolder)
 {
     for (int index = 0; index < enemyHolder.enemies.Length; index++)
     {
         enemiesEncountered[index]      = enemyHolder.enemies[index];
         enemiesEncounteredLevel[index] = enemyHolder.enemyLevel[index];
     }
 }
コード例 #2
0
ファイル: EnemySpawner.cs プロジェクト: OpriaIonut/RPG-game
    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);
    }