话不多说,上代码
using UnityEngine;
using UnityEditor;
using System.IO;
public class CreatFolder
{
[MenuItem("编辑器扩展/3.CreateNewFolder")]
static void CreateNewFolder()
{
//定义路径
var folderPath = Application.dataPath+"/FolderName";
//判断是否存在此目录
if(!Directory.Exists(folderPath))
{
//创建目录
Directory.CreateDirectory(folderPath);
}
//刷新一下
AssetDatabase.Refresh();
}
}
话不多说,上效果

补充:创建文件
string url = Application.persistentDataPath + "/Data/user_data.json";
System.IO.File.Create(url);
4391

被折叠的 条评论
为什么被折叠?



