ProjectStructureCreator/Editor/ProjectStructureCreatorEdit...

39 lines
1.4 KiB
C#

/*
Author: Syntriax <Syntriax@gmail.com>
Creation Date: 22 September, 2022 - 12:48:16 PM UTC
Signed by an automated program written by the author
*/
using UnityEditor;
namespace Syntriax.Editor
{
public class ProjectStructureCreatorEditor : EditorWindow
{
private const string AssetPath = "Assets";
[MenuItem("Tools/Syntriax/Create Project Structure", false, int.MaxValue)]
private static void CreateStructure()
{
CreateSubFolder($"{AssetPath}", "Art");
CreateSubFolder($"{AssetPath}/Art", "Animations");
CreateSubFolder($"{AssetPath}/Art", "Materials");
CreateSubFolder($"{AssetPath}/Art", "Models");
CreateSubFolder($"{AssetPath}/Art", "Textures");
CreateSubFolder($"{AssetPath}/Art", "Audio");
CreateSubFolder($"{AssetPath}/Art/Audio", "Musics");
CreateSubFolder($"{AssetPath}/Art/Audio", "Sounds");
CreateSubFolder($"{AssetPath}", "Scripts");
CreateSubFolder($"{AssetPath}", "Prefabs");
CreateSubFolder($"{AssetPath}/Prefabs", "UI");
}
private static void CreateSubFolder(string parentFolder, string subFolder)
{
if (!AssetDatabase.IsValidFolder($"{parentFolder}/{subFolder}"))
AssetDatabase.CreateFolder(parentFolder, subFolder);
}
}
}