private EnemyType ChangeStat(GameObject enemy, float ratio) { WarriorController wc = enemy.GetComponent <WarriorController>(); // if enemy is a warrior type if (wc != null) { wc.increaseDamage(statIncreaseRatio); return(EnemyType.Warrior); } MageController mm = enemy.GetComponent <MageController>(); // if enemy is a mage type if (mm != null) { mm.increaseDamage(statIncreaseRatio); return(EnemyType.Mage); } return(EnemyType.Support); }
private void ChooseEnemy(int spawnPointIndex) { int enemyType = Random.Range(0, 3); switch (enemyType) { case 0: if (support != null) { SupportController.Create(this, support, spawnPoints[spawnPointIndex].position, spawnPoints[spawnPointIndex].rotation); return; } break; case 1: if (mage != null) { MageController.Create(this, mage, spawnPoints[spawnPointIndex].position, spawnPoints[spawnPointIndex].rotation); return; } break; } WarriorController.Create(this, warrior, spawnPoints[spawnPointIndex].position, spawnPoints[spawnPointIndex].rotation); }