mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-14 19:40:47 +00:00
Update AssetBundleTools
StreamingAssets目录下增加了用于存放打包资源的总文件夹
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace YooAsset.Editor
|
||||
continue;
|
||||
|
||||
string sourcePath = $"{pipelineOutputDirectory}/{patchBundle.BundleName}";
|
||||
string destPath = $"{Application.dataPath}/StreamingAssets/{patchBundle.Hash}";
|
||||
string destPath = $"{AssetBundleBuilderHelper.GetStreamingAssetsFolderPath()}/{patchBundle.Hash}";
|
||||
Debug.Log($"拷贝内置文件到流目录:{patchBundle.BundleName}");
|
||||
EditorTools.CopyFile(sourcePath, destPath, true);
|
||||
}
|
||||
@@ -46,14 +46,14 @@ namespace YooAsset.Editor
|
||||
// 拷贝清单文件
|
||||
{
|
||||
string sourcePath = $"{pipelineOutputDirectory}/{YooAssetSettingsData.Setting.PatchManifestFileName}";
|
||||
string destPath = $"{Application.dataPath}/StreamingAssets/{YooAssetSettingsData.Setting.PatchManifestFileName}";
|
||||
string destPath = $"{AssetBundleBuilderHelper.GetStreamingAssetsFolderPath()}/{YooAssetSettingsData.Setting.PatchManifestFileName}";
|
||||
EditorTools.CopyFile(sourcePath, destPath, true);
|
||||
}
|
||||
|
||||
// 拷贝清单哈希文件
|
||||
{
|
||||
string sourcePath = $"{pipelineOutputDirectory}/{YooAssetSettingsData.Setting.PatchManifestHashFileName}";
|
||||
string destPath = $"{Application.dataPath}/StreamingAssets/{YooAssetSettingsData.Setting.PatchManifestHashFileName}";
|
||||
string destPath = $"{AssetBundleBuilderHelper.GetStreamingAssetsFolderPath()}/{YooAssetSettingsData.Setting.PatchManifestHashFileName}";
|
||||
EditorTools.CopyFile(sourcePath, destPath, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
public static string MakeStreamingLoadPath(string path)
|
||||
{
|
||||
return StringUtility.Format("{0}/{1}", UnityEngine.Application.streamingAssetsPath, path);
|
||||
return StringUtility.Format("{0}/YooAssets/{1}", UnityEngine.Application.streamingAssetsPath, path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user