i have three turrets and when i destroy them i wanna advance to the next level, but in my script how do i let the computer know what the turrets are?
My 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);
}
p.s. i have the script attached to an invisible "dummy" object.