コード例 #1
0
ファイル: MapLoaderWindow.cs プロジェクト: Dracir/CodeBlanche
		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++;
			}	
		}
コード例 #2
0
        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 :(");
            }
        }
コード例 #3
0
        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;
        }
コード例 #4
0
 void showAnalyseTilset()
 {
     GUI.changed = false;
     tilesetPath = RickEditorGUI.FilePath("Load Tileset", tilesetPath, RickEditorGUI.rootFolder, "tsx", true);
     if (GUI.changed)
     {
         loadTileset(tilesetPath);
     }
 }
コード例 #5
0
 void showAnalyseTilset()
 {
     GUI.changed = false;
     tilesetPath = RickEditorGUI.FilePath("Load Tileset", tilesetPath, RickEditorGUI.rootFolder, "tsx", RickEditorGUI.FilePathOptions.KEEP_EXTENTION);
     if (GUI.changed)
     {
         loadTileset(tilesetPath);
     }
 }
コード例 #6
0
        void showInformationSection()
        {
            if (selectedFiles == null)
            {
                return;
            }

            RickEditorGUI.Label("Number of files", selectedFiles.Length + "");
        }
コード例 #7
0
        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);
        }
コード例 #8
0
ファイル: MapLoaderWindow.cs プロジェクト: Dracir/CodeBlanche
		protected override void showGUI() {
			string path = RickEditorGUI.FolderPath("Change Map folder", "", RickEditorGUI.rootFolder);
			if(!string.IsNullOrEmpty(path)){
				loadMapsInfos(path);
			}
			
			if(files != null){
				showMapFiles();
				showOutputPanel();
			}
		}
コード例 #9
0
        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");
        }
コード例 #10
0
 protected override void showGUI()
 {
     multipleFileMod = RickEditorGUI.Toggle("Multiple file loading", multipleFileMod);
     if (multipleFileMod)
     {
         multipleFilePanel.show();
     }
     else
     {
         singleFilePanel.show();
     }
 }
コード例 #11
0
 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);
     }
 }
コード例 #12
0
ファイル: MapLoaderWindow.cs プロジェクト: Dracir/CodeBlanche
		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();
		}
コード例 #13
0
        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));
            }
        }
コード例 #14
0
        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();
            }
        }
コード例 #15
0
 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();
     }
 }
コード例 #16
0
        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();
        }
コード例 #17
0
        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();
            }
        }
コード例 #18
0
 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 :(");
     }
 }
コード例 #19
0
        void showPreviewSection()
        {
            RickEditorGUI.Label("Preview", "");

            shower.show();
        }