i already have the script for when all of my turrets(turret1, turret2, turret3) die i advance to the next level, but what do i attach my script to? (ex. player, turret1, turret2, turret3, all turrets, etc.)
Script:
public var arrIsTurretAlive: boolean[];
public function TurretDestroyed(nTurretID: int)
{
arrIsTurretAlive[nTurretID] = false;
var bWasLiveTurretFound: boolean = false;
for (var nCurrTurret: int = 0 ; nCurrTurret < arrIsTurretAlive.Length ; nCurrTurret++)
{
if (arrIsTurretAlive[nCurrTurret])
{
bWasLiveTurretFound = true;
break;
}
}
if(!bWasLiveTurretFound)
Application.LoadLevel(Application.loadedLevel + 1);
}