public HazardContainer CreateLevel() { char[] delimiterChar = { ' ', '(' }; HazardContainer Level = new HazardContainer(); foreach (GameObject Ship in GameObject.FindGameObjectsWithTag("Ship")) { shipScript = Ship.GetComponent <EditorObjects> (); // The type of the ship is the first part of its name (before the (clone)). String[] ship = Ship.name.Split(delimiterChar); String typeship = ship[0]; Level.Ships.Add(new Ship() { Name = Ship.name, type = typeship, yPos = Ship.transform.position.y, zPos = Ship.transform.position.z, speed = shipScript.speed, movement = shipScript.movement, special = shipScript.special }); } foreach (GameObject Fleet in GameObject.FindGameObjectsWithTag("Formation")) { formationScript = Fleet.GetComponent <FormationScript> (); // The type of the ship is the first part of its name (before the (clone)). String[] fleet = Fleet.name.Split(delimiterChar); String typefleet = fleet[0]; Level.Fleets.Add(new Fleet() { Name = Fleet.name, type = typefleet, yPos = Fleet.transform.position.y, zPos = Fleet.transform.position.z, speed = formationScript.speed, movement = formationScript.movement, special = formationScript.special, ship_type = formationScript.ship }); } foreach (GameObject Asteroid in GameObject.FindGameObjectsWithTag("Asteroid")) { // The type of the ship is the first part of its name (before the (clone)). String[] asteroid = Asteroid.name.Split(delimiterChar); String typeasteroid = asteroid[0]; Level.Asteroids.Add(new Asteroid() { Name = Asteroid.name, type = typeasteroid, yPos = Asteroid.transform.position.y, zPos = Asteroid.transform.position.z }); } Level.Background = toggled_background.name; Level.Music = toggled_music.name; Level.Boss = toggled_boss.name; Level.Ships = Level.Ships.OrderBy(Ship => Ship.zPos).ToList(); Level.Fleets = Level.Fleets.OrderBy(Fleet => Fleet.zPos).ToList(); Level.Asteroids = Level.Asteroids.OrderBy(Asteroid => Asteroid.zPos).ToList(); return(Level); }
void Instantiate() { ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (toggled_object == 0) { } else { // That hazard is now "myCurrentObject" and is placed inside the hazards parent gameObject if (Input.GetMouseButtonDown(0) && Camera.main.ScreenToWorldPoint(Input.mousePosition).y <= 7 && !Physics.Raycast(ray, out hit) && Camera.main.ScreenToWorldPoint(Input.mousePosition).y >= -7 && !EventSystem.current.IsPointerOverGameObject()) { if (toggled_object == 1) { rotation = Quaternion.Euler(0, 180, 30); } else if (toggled_object == 2) { rotation = Quaternion.Euler(0, 0, 330); } else if (toggled_object == 3 || toggled_object == 4 || toggled_object == 5) { rotation = UnityEngine.Random.rotation; } else if (toggled_object == 6 || toggled_object == 7 || toggled_object == 8) { rotation = Quaternion.identity; } myObject = Instantiate(editor_objects[toggled_object - 1], new Vector3(0, Camera.main.ScreenToWorldPoint(Input.mousePosition).y , Camera.main.ScreenToWorldPoint(Input.mousePosition).z), rotation) as GameObject; myObject.transform.parent = hazards.transform; if (toggled_object == 1 || toggled_object == 2) { EditorObjects myObjectScript = myObject.GetComponent <EditorObjects> (); myObjectScript.camera = camera; myObjectScript.canvas = canvas; myObjectScript.selected_panel = selected_panel; myObjectScript.stats_pannel = stats_panel; } else if (toggled_object == 6 || toggled_object == 7 || toggled_object == 8) { FormationScript myObjectScript = myObject.GetComponent <FormationScript> (); myObjectScript.camera = camera; myObjectScript.canvas = canvas; myObjectScript.selected_panel = selected_panel; myObjectScript.stats_fleet = stats_fleet; } } } }
public void T007_Login_007_VerifyPrintFunctionality() { if (!IsTcAdded) { Report.AddToHtmlReportTCHeader("Login Test Cases"); IsTcAdded = true; } Report.AddToHtmlReport("TEAC_1007 : To Verify Print Functionality in Editor.", true, false, true); Report.AddToHtmlReport("STEP 1: Insert Url in Browser Addressbar.", false, true); driver = Browser.OpenWithSelectedBrowser(driver, ProjectUrl, true); EditorObjects objEditorObjects = new EditorObjects(); driver = objEditorObjects.T007_Login_007_VerifyPrintFunctionality(driver); if (Convert.ToInt16(ConfigurationSettings.AppSettings.Get("CloseBrowser")) == 1) { Browser.CloseBrowser(driver); } }
internal static void GetFilesNeededOnDiskBy(string absoluteName, EditorObjects.Parsing.TopLevelOrRecursive topLevelOrRecursive, List<string> listToFill) { SaveRelativeDirectory(); CallMethodOnPluginNotUiThread( delegate (PluginBase plugin) { if (plugin.GetFilesNeededOnDiskBy != null) { plugin.GetFilesNeededOnDiskBy(absoluteName, listToFill); } else if (plugin.GetFilesReferencedBy != null) { plugin.GetFilesReferencedBy(absoluteName, topLevelOrRecursive, listToFill); } }, "GetFilesReferencedBy"); ResumeRelativeDirectory("GetFilesReferencedBy"); }
public static ReferencedFileSave AddReferencedFile(this IElement instance, string fileName, AssetTypeInfo ati, EditorObjects.SaveClasses.BuildToolAssociation bta = null) { var referencedFileSave = new ReferencedFileSave(); if (ati != null) { referencedFileSave.RuntimeType = ati.QualifiedRuntimeTypeName.QualifiedType; } referencedFileSave.IsSharedStatic = true; referencedFileSave.SetNameNoCall(fileName); #if GLUE if (ati != null && !string.IsNullOrEmpty(ati.CustomBuildToolName) && bta != null) { referencedFileSave.BuildTool = ati.CustomBuildToolName; referencedFileSave.SourceFile = referencedFileSave.Name; string newName = FileManager.RemoveExtension(referencedFileSave.Name); newName += "." + bta.DestinationFileType; referencedFileSave.SetNameNoCall(newName); } #endif instance.ReferencedFiles.Add(referencedFileSave); referencedFileSave.IsSharedStatic = true; return referencedFileSave; }
public IEnumerable<string> GetFilesReferencedBy(string absoluteName, EditorObjects.Parsing.TopLevelOrRecursive topLevelOrRecursive) { return FileReferenceManager.Self.GetFilesReferencedBy(absoluteName, topLevelOrRecursive); }
public IEnumerable<string> GetFilesReferencedBy(ReferencedFileSave file, EditorObjects.Parsing.TopLevelOrRecursive topLevelOrRecursive) { var absolute = GlueCommands.Self.GetAbsoluteFileName(file); return GetFilesReferencedBy(absolute, topLevelOrRecursive); }
private void HandleGetReferencedFiles(string fileName, EditorObjects.Parsing.TopLevelOrRecursive topLevelOrRecursive, List<string> referencedFiles) { }