protected override void OnDestroy()
{
Dynamic parent = (Dynamic)Parent;
//hide attached objects for this influence
foreach( MapObjectAttachedObject attachedObject in parent.AttachedObjects )
{
if( attachedObject.Alias == Type.Name )
attachedObject.Visible = false;
}
//destroy default particle system
if( defaultAttachedParticle != null )
{
parent.Detach( defaultAttachedParticle );
defaultAttachedParticle = null;
}
base.OnDestroy();
}