Last active
April 5, 2025 18:52
-
-
Save ysalihtuncel/bb99482da61765cbd5c8611fcb0ecdbe to your computer and use it in GitHub Desktop.
Folder Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using static System.IO.Directory; | |
using static System.IO.Path; | |
using static UnityEditor.AssetDatabase; | |
public class Setup : MonoBehaviour | |
{ | |
[MenuItem("Tools/Setup/Create Default Folders")] | |
public static void CreateDefaultFolders() | |
{ | |
Folders.CreateDefault("_Project", "Resources", "Materials", "Models", "Prefabs", "Textures", "Scripts", "Editor", "ScriptableObjects", "Animations", "Scenes"); | |
Refresh(); | |
} | |
static class Folders | |
{ | |
public static void CreateDefault(string root, params string[] folders) | |
{ | |
var fullpath = Combine(Application.dataPath, root); | |
foreach (var folder in folders) | |
{ | |
var path = Combine(fullpath, folder); | |
if (!Exists(path)) | |
{ | |
CreateDirectory(path); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment