public void Clone(EnemyMinion minion) { this.prefabName = minion.GetName(); this.health = minion.GetHealth(); this.damage = minion.GetDamage(); this.armour = minion.GetArmour(); }
public EnemyMinion[] SpawnWave() { EnemyMinionFactory minionFactory = new EnemyMinionFactory(); EnemyMinion[] listOfWave = new EnemyMinion[wave.Length]; for (int i = 0; i < wave.Length; i++) { listOfWave[i] = minionFactory.MakeEnemyMinion(wave[i]); } return(listOfWave); }
private void InstantiateEnemy(EnemyMinion minion) { GameObject enemyMinion = Resources.Load("Characters/Enemy/" + minion.GetName()) as GameObject; if (enemyMinion != null) { if (enemyMinion.GetComponent("MinionData") != null) { //enemyMinion.GetComponent<MinionData>().Clone(minion); } else { enemyMinion.AddComponent <MinionData>(); enemyMinion.GetComponent <MinionData>().Clone(minion); } enemyMinion.tag = "player2"; Instantiate(enemyMinion, this.transform.position, this.transform.rotation); } else { Debug.Log("Can not spawn null..."); } }
public EnemyMinion[] SpawnWave() { EnemyMinionFactory minionFactory = new EnemyMinionFactory(); int length = Random.Range(1, 4); EnemyMinion[] listOfWave = new EnemyMinion[length]; for (int i = 0; i < length; i++) { int randNum = Random.Range(1, 10); if (randNum >= 1 && randNum < 6) { listOfWave[i] = minionFactory.MakeEnemyMinion(wave[0]); } else if (randNum >= 6 && randNum < 10) { listOfWave[i] = minionFactory.MakeEnemyMinion(wave[1]); } else { listOfWave[i] = minionFactory.MakeEnemyMinion(wave[2]); } } return(listOfWave); }
void Reset() { Owner = GetComponentInParent <EnemyMinion>(); }