Skip to content

Instantly share code, notes, and snippets.

@ysalihtuncel
Last active April 5, 2025 18:52
Show Gist options
  • Save ysalihtuncel/bb99482da61765cbd5c8611fcb0ecdbe to your computer and use it in GitHub Desktop.
Save ysalihtuncel/bb99482da61765cbd5c8611fcb0ecdbe to your computer and use it in GitHub Desktop.
Folder Setup
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