Пример #1
0
		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
        void ShowPath()
        {
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();

            GUIStyle style = new GUIStyle("boldLabel");

            EditorGUILayout.LabelField("Path".ToGUIContent(), style, GUILayout.Width(45));
            Path = CustomEditorBase.FolderPathButton(Path, assetsPath);

            GUILayout.Space(5);

            EditorGUILayout.EndHorizontal();

            Folder = EditorGUILayout.Toggle("Create Folder", Folder);

            string folderPath = string.Format("{0}{1}{2}", assetsPath, System.IO.Path.AltDirectorySeparatorChar, Path);

            if (!Directory.Exists(folderPath))
            {
                EditorGUILayout.HelpBox("Selected directory does not exist.", MessageType.Warning);
                height += 44;
            }
            else if (!Folder && Directory.GetFiles(folderPath).Length > 0)
            {
                EditorGUILayout.HelpBox("Selected directory is not empty.", MessageType.Warning);
                height += 44;
            }

            CustomEditorBase.Separator();
        }
Пример #3
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 :(");
            }
        }
Пример #4
0
        void ShowGeneratesButton()
        {
            if (CustomEditorBase.LargeButton("Generate".ToGUIContent()))
            {
                Generate();
            }

            CustomEditorBase.Separator();
        }
Пример #5
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");
        }
Пример #6
0
		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();
		}
Пример #7
0
        void ShowStates()
        {
            EditorGUILayout.LabelField("States", new GUIStyle("boldLabel"), GUILayout.Width(100));

            EditorGUI.indentLevel += 1;

            for (int i = 0; i < states.Count; i++)
            {
                bool locked = lockedStates.Contains(states[i]);

                EditorGUILayout.BeginHorizontal();
                EditorGUI.BeginDisabledGroup(locked);

                states[i] = EditorGUILayout.TextField(states[i]);

                EditorGUI.EndDisabledGroup();

                if (i == 0)
                {
                    if (CustomEditorBase.SmallAddButton())
                    {
                        AddState("");
                    }
                }
                else
                {
                    EditorGUI.BeginDisabledGroup(locked);

                    if (CustomEditorBase.DeleteButton())
                    {
                        RemoveState(i);
                        break;
                    }

                    EditorGUI.EndDisabledGroup();
                }

                GUILayout.Space(6);

                EditorGUILayout.EndHorizontal();
            }

            if (EditorGUIUtility.editingTextField && Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Tab)
            {
                AddState("");
            }

            EditorGUI.indentLevel -= 1;
            CustomEditorBase.Separator();
        }
Пример #8
0
        void ShowLayer()
        {
            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.LabelField("Layer", new GUIStyle("boldLabel"), GUILayout.Width(100));
            Layer = EditorGUILayout.TextField(Layer);

            EditorGUILayout.EndHorizontal();

            ShowMachine();
            ShowInherit();
            ShowSubLayer();
            ShowCallbacks();

            CustomEditorBase.Separator();
        }
Пример #9
0
        void showLinkerSelectionPanel()
        {
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Create New Linker"))
            {
                createNewLinker();
            }
            if (GUILayout.Button("Refresh Linker list"))
            {
                refreshLinkerList();
            }
            GUILayout.EndHorizontal();
            CustomEditorBase.Separator();

            showLinkerList();
        }
Пример #10
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();
            }
        }
Пример #11
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();
            }
        }
Пример #12
0
 protected override void showGUI()
 {
     if (previewTextures == null)
     {
         loadTextures();
     }
     showSelectionButtons();
     if (currentAutotile != null)
     {
         CustomEditorBase.Separator();
         scrollView = EditorGUILayout.BeginScrollView(scrollView);
         showDataSection();
         CustomEditorBase.Separator();
         showInputSection();
         CustomEditorBase.Separator();
         showPreviewSection();
         CustomEditorBase.Separator();
         showOutputSection();
         EditorGUILayout.EndScrollView();
     }
 }
Пример #13
0
        void OnGUI()
        {
            serializedObject  = new SerializedObject(this);
            materialsProperty = serializedObject.FindProperty("materials");


            EditorGUILayout.Space();

            ShowFilters();

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();
            scrollView = EditorGUILayout.BeginScrollView(scrollView);

            ShowMaterials("Background", backgroundMaterials);
            EditorGUILayout.Space();
            ShowMaterials("Geometry", geometryMaterials);
            EditorGUILayout.Space();
            ShowMaterials("Transparent", transparentMaterials);
            EditorGUILayout.Space();
            ShowMaterials("Overlay", overlayMaterials);

            CustomEditorBase.Separator();

            EditorGUILayout.EndScrollView();
            if (EditorGUI.EndChangeCheck())
            {
                changed = true;
            }

            if (changed && Event.current.type == EventType.MouseMove && !EditorGUIUtility.editingTextField)
            {
                SetOrdererMaterials();
                changed = false;
                Event.current.Use();
            }

            serializedObject.ApplyModifiedProperties();
        }
Пример #14
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 :(");
     }
 }
Пример #15
0
 protected void makeSeparator()
 {
     CustomEditorBase.Separator();
 }