示例#1
0
 /// <summary>
 /// Add a MovableObjectDefinition.
 /// </summary>
 /// <param name="definition">The definition to add.</param>
 public void addMovableObjectDefinition(MovableObjectDefinition definition)
 {
     movableObjects.Add(definition.Name, definition);
     if (editInterface != null)
     {
         addMovableObjectEdit(definition);
     }
 }
示例#2
0
 /// <summary>
 /// Remove a MovableObjectDefinition.
 /// </summary>
 /// <param name="definition">The definition to remove.</param>
 public void removeMovableObjectDefinition(MovableObjectDefinition definition)
 {
     movableObjects.Remove(definition.Name);
     if (editInterface != null)
     {
         editInterface.removeSubInterface(definition);
     }
 }
示例#3
0
 /// <summary>
 /// Add an Entity to the node. This will attach it to the SceneNode.
 /// </summary>
 /// <param name="identifier">The identifier of the Entity.</param>
 /// <param name="entity">The Entity to attach.</param>
 public void attachObject(MovableObjectDefinition definition)
 {
     if (!nodeObjects.ContainsKey(definition.Name))
     {
         MovableObjectContainer moveObj = definition.createProduct(scene, Owner.Name + Name);
         if (moveObj != null)
         {
             sceneNode.attachObject(moveObj.MovableObject);
             nodeObjects.Add(moveObj.DefinitionName, moveObj);
         }
     }
     else
     {
         Log.Default.sendMessage("Attempted to add another MovableObject to the node {0} named {1} that already exists. The second entry has been ignored.", LogLevel.Warning, "OgrePlugin", Owner.Name + Name, definition.Name);
     }
 }
示例#4
0
 /// <summary>
 /// Helper function to add an EditInterface for an EntityDefinition.
 /// </summary>
 /// <param name="definition"></param>
 private void addMovableObjectEdit(MovableObjectDefinition definition)
 {
     editInterface.addSubInterface(definition, definition.getEditInterface());
 }