private void morirEnemigos()
{
GameObject[] games;
games = GameObject.FindGameObjectsWithTag("civil");
foreach(var civil in games){ //Miro todos los Unit y si hay alguno de owner lo sumo
if(civil.GetComponent<CivilUnit>().owner!=player){
Destroy(civil, 2);
}
}
games = GameObject.FindGameObjectsWithTag("townCenter");
foreach(var town in games){ //Miro todos los Unit y si hay alguno de owner lo sumo
if(town.GetComponent<TownCenterBuilding>().owner!=player){
Destroy(town, 2);
}
}
games = GameObject.FindGameObjectsWithTag("mility");
foreach(var mili in games){ //Miro todos los Unit y si hay alguno de owner lo sumo
if(mili.GetComponent<Unit>().owner!=player){
Destroy(mili, 2);
}
}
games = GameObject.FindGameObjectsWithTag("armyBuilding");
foreach(var army in games){ //Miro todos los Unit y si hay alguno de owner lo sumo
if(army.GetComponent<ArmyBuilding>().owner!=player){
Destroy(army, 2);
}
}
games = GameObject.FindGameObjectsWithTag("academy");
foreach(var aca in games){ //Miro todos los Unit y si hay alguno de owner lo sumo
if(aca.GetComponent<Academy>().owner!=player){
Destroy(aca, 2);
}
}
}