private void createSimObject(object editingObject) { if (simObjectController != null) { Instance instance = editingObject as Instance; simObjectController.destroySimObject(instance.Name); SimObject simObj = simObjectController.createSimObject(instance.Definition); if (simObj != null && !showInstance) { simObj.Enabled = showInstance; } } }
public void createInstance(SimObjectController simObjectController) { if (instance != null) { if (!simObjectController.hasSimObject(instance.Name)) { simObjectController.createSimObject(instance.Definition); this.simObjectController = simObjectController; } else { Log.Warning("A SimObject named {0} already exists in the scene. This instance has not been created.", Name); } } else { Log.Error("Could not create SimObject {0} because the instance definition could not be loaded.", instance.Name); } }