Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using UnityEditor;
- using UnityEngine;
- public class CreateFolders : EditorWindow {
- private float _space = 20f;
- private List<string> list = new List<string>();
- [MenuItem("Unity/Create structure")]
- static void CreateFolder() {
- GetWindow<CreateFolders>("Create your structure");
- }
- private void OnGUI() {
- GUILayout.Label("Here you can write the names of your folders", EditorStyles.largeLabel);
- GUILayout.Space(_space);
- Debug.Log(list.Count);
- for (int i = 0; i < list.Count; i++) {
- list[i] = GUILayout.TextField(list[i]);
- }
- if (GUILayout.Button("Add folder")) {
- list.Add("");
- }
- if (GUILayout.Button("Create structure")) {
- foreach (var item in list) {
- if (AssetDatabase.IsValidFolder($"Assets/{item}")) {
- return;
- }
- string folders = AssetDatabase.CreateFolder("Assets", item);
- AssetDatabase.GUIDToAssetPath(folders);
- }
- }
- if (GUILayout.Button("Close")) {
- Close();
- }
- }
- [MenuItem("Unity/Organize files")]
- static void OrganizeFiles() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement