void showMapFiles() { CustomEditorBase.Separator(); RickEditorGUI.Label("INPUT :", selectedPath); GUILayout.Space(4); if(selectAllToglle){ selectAllToglle = RickEditorGUI.Toggle("Select all",true); if(!selectAllToglle){ for (int i = 0; i < selectedFiles.Length; i++) { selectedFiles[i] = false; } } }else{ selectAllToglle = RickEditorGUI.Toggle("Select all",false); if(selectAllToglle){ for (int i = 0; i < selectedFiles.Length; i++) { selectedFiles[i] = true; } } } GUILayout.Space(8); int index = 0; foreach (FileInfo fileInfo in files) { if(fileInfo.Exists){ selectedFiles[index] = RickEditorGUI.Toggle(fileInfo.Name, selectedFiles[index]); } index++; } }
protected override void showGUI() { showAnalyseTilset(); if (linker.tilesets.Count > 0) { CustomEditorBase.Separator(); showTilesetSelector(); if (selectedTileset != null) { scroolPos = EditorGUILayout.BeginScrollView(scroolPos); showTileset(); EditorGUILayout.EndScrollView(); if (selectedTile != null) { CustomEditorBase.Separator(); showTile(); } } } else { RickEditorGUI.Label("", "No Tileset Loaded :("); } }
void showTile() { RickEditorGUI.Label("Tile id", selectedTile.id + ""); GUI.changed = false; selectedTile.prefab = (GameObject)RickEditorGUI.ObjectField("Prefab", selectedTile.prefab, typeof(GameObject), false); dataChanged |= GUI.changed; }
void showAnalyseTilset() { GUI.changed = false; tilesetPath = RickEditorGUI.FilePath("Load Tileset", tilesetPath, RickEditorGUI.rootFolder, "tsx", true); if (GUI.changed) { loadTileset(tilesetPath); } }
void showAnalyseTilset() { GUI.changed = false; tilesetPath = RickEditorGUI.FilePath("Load Tileset", tilesetPath, RickEditorGUI.rootFolder, "tsx", RickEditorGUI.FilePathOptions.KEEP_EXTENTION); if (GUI.changed) { loadTileset(tilesetPath); } }
void showInformationSection() { if (selectedFiles == null) { return; } RickEditorGUI.Label("Number of files", selectedFiles.Length + ""); }
void showTile() { RickEditorGUI.Label("Tile id", selectedTile.id + ""); GameObject beforeGameObject = selectedTile.prefab; GUI.changed = false; selectedTile.prefab = (GameObject)RickEditorGUI.ObjectField("Prefab", selectedTile.prefab, typeof(GameObject), false); dataChanged |= GUI.changed || (beforeGameObject == null && selectedTile.prefab != null) || (beforeGameObject != selectedTile.prefab); }
protected override void showGUI() { string path = RickEditorGUI.FolderPath("Change Map folder", "", RickEditorGUI.rootFolder); if(!string.IsNullOrEmpty(path)){ loadMapsInfos(path); } if(files != null){ showMapFiles(); showOutputPanel(); } }
void showOptions() { loadToPrefab = RickEditorGUI.Toggle("Load As Prefab", loadToPrefab); if (loadToPrefab) { prefabFolder = RickEditorGUI.FolderPath("Asset Prefab Folder", prefabFolder, RickEditorGUI.assetFolder); } CustomEditorBase.Separator(); filePath = RickEditorGUI.FilePath("Map ", filePath, RickEditorGUI.rootFolder, "tmx"); }
protected override void showGUI() { multipleFileMod = RickEditorGUI.Toggle("Multiple file loading", multipleFileMod); if (multipleFileMod) { multipleFilePanel.show(); } else { singleFilePanel.show(); } }
void showTilesetSelector() { string[] tilsetChoicesText = new string[linker.tilesets.Count]; for (int index = 0; index < linker.tilesets.Count; index++) { tilsetChoicesText[index] = linker.tilesets[index].name; } GUI.changed = false; selectedTilesetIndex = RickEditorGUI.Popup("Editing Tileset", selectedTilesetIndex, tilsetChoicesText); if (GUI.changed) { switchShownTile(selectedTilesetIndex); } }
void showOutputPanel() { CustomEditorBase.Separator(); RickEditorGUI.Label("Output",""); GUILayout.Space(4); const string seprateTooltip = "Determine whether the Tiles are loaded in Parent GameObjects based on the Tile's Layer or all tiles are put in the same parent."; separatePrefabByTiledLayers = RickEditorGUI.Toggle("Use Layers", seprateTooltip, separatePrefabByTiledLayers); loadToPrefab = RickEditorGUI.Toggle("Load As Prefab", loadToPrefab); if (loadToPrefab) { prefabFolder = RickEditorGUI.FolderPath("Asset Prefab Folder", prefabFolder, RickEditorGUI.assetFolder); } showButton(); }
void OnGUI() { prefabFilePath = RickEditorGUI.FilePath("Prefab to rotate", prefabFilePath, RickEditorGUI.resourcesFolder, "prefab"); if (CustomEditorBase.Button(new GUIContent("Make rotated prefab"))) { string filePath = "Assets/Resources" + prefabFilePath; GameObject prefabToRotate = (GameObject)AssetDatabase.LoadAssetAtPath(filePath + ".prefab", typeof(GameObject)); int dotIndex = filePath.LastIndexOf('/'); string fileFolder = filePath.Substring(0, dotIndex); nameRotation(prefabToRotate, fileFolder, "90", new Vector3(0, 0, 90)); nameRotation(prefabToRotate, fileFolder, "180", new Vector3(0, 0, 180)); nameRotation(prefabToRotate, fileFolder, "-90", new Vector3(0, 0, -90)); } }
void showSelectOrCreateLinkerPanel() { GUI.changed = false; linkerPath = RickEditorGUI.FilePath("Load Linker", linkerPath, RickEditorGUI.assetFolder, "asset", true); if (GUI.changed) { loadNewLinker(); onLinkerLoaded(); } CustomEditorBase.Separator(); if (GUILayout.Button("CreateNewLinker")) { createNewLinker(); } }
void showInputSection() { RickEditorGUI.Label("Input", ""); RickEditorGUI.Label("", "Modes placeHolder"); GUI.changed = false; currentAutotile.center = showInputLine("Center", previewTextures[TILE_CENTER], currentAutotile.center); currentAutotile.cornerOutside = showInputLine("Outside Corner", previewTextures[TILE_CORNER_OUTSIDE], currentAutotile.cornerOutside); currentAutotile.side = showInputLine("Side", previewTextures[TILE_STRAIGHT], currentAutotile.side); currentAutotile.cornerInside = showInputLine("Inside Corner", previewTextures[TILE_CORNER_INSIDE], currentAutotile.cornerInside); if (GUI.changed) { dataChanged = true; shower.loadTextures(); } if (GUILayout.Button("Autoload Based on Center")) { autoLoadBasedOnCenter(); } }
void showSelectionButtons() { GUILayout.BeginHorizontal(); string[] autoTileChoices = new string[linker.autotiles.Count]; for (int index = 0; index < linker.autotiles.Count; index++) { autoTileChoices[index] = linker.autotiles[index].name; if (String.IsNullOrEmpty(autoTileChoices[index])) { autoTileChoices[index] = "* NO NAME * (" + index + ")"; } } GUI.changed = false; selectedAutoTileIndex = RickEditorGUI.Popup("Editing Tileset", selectedAutoTileIndex, autoTileChoices); if (GUI.changed) { switchAutoTile(selectedAutoTileIndex); } if (CustomEditorBase.Button(new GUIContent("Delete"))) { linker.autotiles.Remove(currentAutotile); selectedAutoTileIndex = selectedAutoTileIndex - 1; if (selectedAutoTileIndex >= 0) { switchAutoTile(selectedAutoTileIndex); } else { currentAutotile = null; } } if (CustomEditorBase.Button(new GUIContent("New Autotile"))) { currentAutotile = new AutotileData(); linker.autotiles.Add(currentAutotile); selectedAutoTileIndex = linker.autotiles.Count - 1; switchAutoTile(selectedAutoTileIndex); } GUILayout.EndHorizontal(); }
void showOutputSection() { RickEditorGUI.Label("Output-Tiled AutoTiles", ""); currentAutotile.tilesFileName = EditorGUILayout.TextField("TilesetName.tmx", currentAutotile.tilesFileName); if (GUILayout.Button("Export")) { currentAutotile.autoTileFilePath = EditorUtility.SaveFilePanel("Autotile file", RickEditorGUI.rootFolder, "autotile", "tmx"); //currentAutotile.autoTileFilePath = "C:/Users/The User/Documents/Unity Games/jeux/ITT1_EndlessTowerClimber/autotile.tmx"; export(); } CustomEditorBase.Separator(); RickEditorGUI.Label("Output-Create Prefab", ""); currentAutotile.basePrefab = (GameObject)EditorGUILayout.ObjectField("Base prefab", currentAutotile.basePrefab, typeof(GameObject), false); currentAutotile.outputAssetFolder = RickEditorGUI.FolderPath("Destination folder", currentAutotile.outputAssetFolder, RickEditorGUI.assetFolder); if (GUILayout.Button("Make Copies")) { makeCopie(); } }
protected override void showGUI() { showAnalyseTilset(); if (linker.tilesets.Count > 0) { CustomEditorBase.Separator(); showTilesetSelector(); if (selectedTileset != null) { showTileset(); if (selectedTile != null) { CustomEditorBase.Separator(); showTile(); } } } else { RickEditorGUI.Label("", "No Tileset Loaded :("); } }
void showPreviewSection() { RickEditorGUI.Label("Preview", ""); shower.show(); }