internal static void Handle() { foreach (var folderName in folderNames) { CreateDirectoryIfNotExist(Path.Combine(Application.dataPath, folderName)); } if (folderNames.Contains("_Resources")) { CreateDirectoryIfNotExist(Path.Combine(Path.Combine(Application.dataPath, "_Resources"), "Resources")); } if (folderNames.Contains("_Scripts")) { var fileStream = CreateFileIfNotExist(Path.Combine(Path.Combine(Application.dataPath, "_Scripts"), "README.txt")); if (fileStream != null) { try { StreamWriter sw = new StreamWriter(fileStream); sw.Write("该目录为游戏工程脚本目录"); sw.Close(); } catch (Exception e) { L7Debug.LogError(e.ToString()); } } } AssetDatabase.Refresh(); }
static void Handle() { EditorUtility.DisplayProgressBar("pack", "pack", 0); AssetDatabase.ExportPackage(toExport, Path.Combine(Application.dataPath, "UnityUtils.unitypackage"), ExportPackageOptions.Recurse); EditorUtility.ClearProgressBar(); L7Debug.Log("导出成功"); }