![]() |
|
#1
|
|||
|
|||
|
Edit: Even better code to destroy all aircraft
Code:
if (GamePlay.gpArmies() != null && GamePlay.gpArmies().Length > 0)
{
foreach (int armyIndex in GamePlay.gpArmies())
{
if (GamePlay.gpAirGroups(armyIndex) != null && GamePlay.gpAirGroups(armyIndex).Length > 0)
{
foreach (AiAirGroup airGroup in GamePlay.gpAirGroups(armyIndex))
{
if (airGroup.GetItems() != null && airGroup.GetItems().Length > 0)
{
foreach (AiActor actor in airGroup.GetItems())
{
if (actor is AiAircraft)
{
AiAircraft aircraft = actor as AiAircraft;
aircraft.Destroy();
}
}
}
}
}
}
}
Last edited by 41Sqn_Banks; 12-18-2011 at 12:43 PM. |
| Thread Tools | |
| Display Modes | |
|
|