You can always cast from AiAircraft to AiActor but you can not always cast from AiActor to AiAircraft.
You can check if its possible to cast from AiActor to AiAircraft by this:
Code:
AiActor actor;
if( actor is AiAircraft )
{
AiAircraft aircraft = actor as AiAircraft;
...
}
If the "as" operator fails it returns null. This can be checked by
Code:
AiAircraft aircraft = actor as AiAircraft;
if(aircraft != null)
{
...
}
Of course its not necessary to check the success of the "as" operator if the "is" operator was successful.