Unity代码创建
原创
©著作权归作者所有:来自51CTO博客作者A武汉创品科的原创作品,请联系作者获取转载授权,否则将追究法律责任
利用Unity 自带的类创建常用的文件夹
public static class SystemUtility
{
[MenuItem("Tools/InitFolder")]
public static void InitFolder()
{
CreateFolder("Arts");
CreateFolder("3D");
CreateFolder("2D");
CreateFolder("Plugins");
CreateFolder("ResAB");
CreateFolder("Resources");
CreateFolder("Scripts");
CreateFolder("StreamingAssets");
CreateFolder("ToLua");
AssetDatabase.Refresh();
}
public static void CreateFolder(string fileName)
{
Directory.CreateDirectory(Application.dataPath + "/" + fileName);
}
}