public void destroyInstance(SimObjectController simObjectController) { if (this.simObjectController != null) { this.simObjectController = null; simObjectController.destroySimObject(Name); setVisible(true); } }
public void destroyInstances(SimObjectController simObjectController) { this.simObjectController = null; this.instancesDisplayed = false; foreach (InstanceFileInterface instanceFileInterface in instanceFiles.Values) { instanceFileInterface.destroyInstance(simObjectController); } foreach (InstanceGroup group in groups.Values) { group.destroyInstances(simObjectController); } }
public void showInstances(SimObjectController simObjectController) { this.simObjectController = simObjectController; this.instancesDisplayed = true; foreach (InstanceFileInterface instanceFileInterface in instanceFiles.Values) { instanceFileInterface.createInstance(simObjectController); } foreach (InstanceGroup group in groups.Values) { group.showInstances(simObjectController); } }
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); } }
private IEnumerable <IdleStatus> finishInitialization() { splashScreen.updateStatus(10, "Loading Solution"); yield return(IdleStatus.Ok); //Load the config file and set the resource root up. VirtualFileSystem.Instance.addArchive(solution.ResourceRoot); resourceController = new ResourceController(this); solution.loadExternalFiles(this); MyGUIPlugin.ResourceManager.Instance.load("Anomaly.Resources.AnomalyImagesets.xml"); //Initialize controllers instanceBuilder = new InstanceBuilder(); sceneController.initialize(this); sceneController.OnSceneLoaded += sceneController_OnSceneLoaded; sceneController.OnSceneUnloading += sceneController_OnSceneUnloading; simObjectController = new SimObjectController(this); fixedUpdate = new FullSpeedUpdateListener(sceneController); mainTimer.addUpdateListener(fixedUpdate); splashScreen.updateStatus(60, "Creating GUI"); yield return(IdleStatus.Ok); propertiesEditor = new PropertiesEditor("Properties", "Anomaly.GUI.Properties", false); guiManager.addManagedDialog(propertiesEditor); interfaceRenderer = new EditInterfaceRendererController(pluginManager.RendererPlugin, mainTimer, sceneController, propertiesEditor); solutionWindow = new SolutionWindow(); guiManager.addManagedDialog(solutionWindow); mainObjectEditor = new PropertiesEditor("Object Editor", "Anomaly.GUI.ObjectEditor", true); mainObjectEditor.AllowedDockLocations = DockLocation.Floating; mainObjectEditor.CurrentDockLocation = DockLocation.Floating; guiManager.addManagedDialog(mainObjectEditor); solutionController = new SolutionController(solution, solutionWindow, this, propertiesEditor); //Initialize the windows propertiesEditor.AutoExpand = true; //Create GUI consoleWindow = new LogWindow(); guiManager.addManagedDialog(consoleWindow); Log.Default.addLogListener(consoleWindow); debugVisualizer = new DebugVisualizer(pluginManager, sceneController); guiManager.addManagedDialog(debugVisualizer); if (File.Exists(AnomalyConfig.WindowsFile)) { ConfigFile configFile = new ConfigFile(AnomalyConfig.WindowsFile); configFile.loadConfigFile(); guiManager.loadSavedUI(configFile, new Version("1.0.0.0")); //Show Windows Default solutionWindow.Visible = true; propertiesEditor.Visible = true; consoleWindow.Visible = true; debugVisualizer.Visible = true; } else { //Show Windows Default solutionWindow.Visible = true; propertiesEditor.showRelativeTo(solutionWindow, WindowAlignment.Right); consoleWindow.Visible = true; debugVisualizer.Visible = true; } yield return(IdleStatus.Ok); splashScreen.updateStatus(80, "Building Scene"); buildScene(); yield return(IdleStatus.Ok); splashScreen.updateStatus(100, "Loaded"); splashScreen.hide(); yield return(IdleStatus.Ok); if (FullyLoaded != null) { FullyLoaded.Invoke(this); } }