public void DestroyAllMovableObjectsByType( string typeName )
{
// Nasty hack to make generalized Camera functions work without breaking add-on SMs
if ( typeName == "Camera" )
{
this.DestroyAllCameras();
return;
}
MovableObjectCollection objectMap = this.GetMovableObjectCollection( typeName );
MovableObjectFactory factory = Root.Instance.GetMovableObjectFactory( typeName );
lock ( objectMap )
{
foreach ( MovableObject movableObject in objectMap.Values )
{
if ( movableObject.Manager == this )
{
MovableObject tmp = movableObject;
factory.DestroyInstance( ref tmp );
}
}
objectMap.Clear();
}
}