Axiom.Core.SceneManager.DestroyAllMovableObjectsByType C# (CSharp) Method

DestroyAllMovableObjectsByType() public method

public DestroyAllMovableObjectsByType ( string typeName ) : void
typeName string
return void
		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();
			}
		}
SceneManager