Update AssetBundleTools

StreamingAssets目录下增加了用于存放打包资源的总文件夹
This commit is contained in:
hevinci
2022-04-07 19:18:33 +08:00
parent b7a20d4bdb
commit d6b54dd49c
3 changed files with 18 additions and 10 deletions

View File

@@ -17,6 +17,14 @@ namespace YooAsset.Editor
return $"{projectPath}/Bundles";
}
/// <summary>
/// 获取流文件夹路径
/// </summary>
public static string GetStreamingAssetsFolderPath()
{
return $"{Application.dataPath}/StreamingAssets/YooAssets/";
}
/// <summary>
/// 获取构建管线的输出目录
/// </summary>
@@ -30,8 +38,8 @@ namespace YooAsset.Editor
/// </summary>
public static void ClearStreamingAssetsFolder()
{
string streamingPath = Application.dataPath + "/StreamingAssets";
EditorTools.ClearFolder(streamingPath);
string streamingFolderPath = GetStreamingAssetsFolderPath();
EditorTools.ClearFolder(streamingFolderPath);
}
/// <summary>
@@ -40,17 +48,17 @@ namespace YooAsset.Editor
/// </summary>
public static void DeleteStreamingAssetsIgnoreFiles()
{
string streamingPath = Application.dataPath + "/StreamingAssets";
if (Directory.Exists(streamingPath))
string streamingFolderPath = GetStreamingAssetsFolderPath();
if (Directory.Exists(streamingFolderPath))
{
string[] files = Directory.GetFiles(streamingPath, "*.manifest", SearchOption.AllDirectories);
string[] files = Directory.GetFiles(streamingFolderPath, "*.manifest", SearchOption.AllDirectories);
foreach (var file in files)
{
FileInfo info = new FileInfo(file);
info.Delete();
}
files = Directory.GetFiles(streamingPath, "*.meta", SearchOption.AllDirectories);
files = Directory.GetFiles(streamingFolderPath, "*.meta", SearchOption.AllDirectories);
foreach (var item in files)
{
FileInfo info = new FileInfo(item);