mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-20 23:30:08 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b6a8ca406 | ||
|
|
c8e45a6cae | ||
|
|
1fbc9d26a6 | ||
|
|
abb087b02e | ||
|
|
aeaf03011f | ||
|
|
78d24ad3a6 | ||
|
|
aab2c4625e | ||
|
|
079ef75605 | ||
|
|
75881b55f6 | ||
|
|
2020c7d508 | ||
|
|
088d939346 | ||
|
|
fa50e91c9f | ||
|
|
2e7b992a4b | ||
|
|
29fbbd97ff | ||
|
|
abb150e33f | ||
|
|
78e20f434e | ||
|
|
304222b788 |
@@ -2,6 +2,57 @@
|
|||||||
|
|
||||||
All notable changes to this package will be documented in this file.
|
All notable changes to this package will be documented in this file.
|
||||||
|
|
||||||
|
## [2.3.18] - 2025-12-04
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (#676) 修复了UniTask扩展包的编译报错。
|
||||||
|
- (#684) 修复了资源配置窗口Group列表数量过多的时候,添加和删除按钮会变小的问题。
|
||||||
|
- (#700) [**严重**] 修复了小游戏扩展库的下载器再失败后重试逻辑不起效的问题。
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- (#683) 新增了内置文件系统类初始化参数:UNPACK_FILE_SYSTEM_ROOT
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
class FileSystemParametersDefine
|
||||||
|
{
|
||||||
|
// 指定解压文件的根目录
|
||||||
|
public const string UNPACK_FILE_SYSTEM_ROOT = "UNPACK_FILE_SYSTEM_ROOT";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#682) 原生文件构建管线新增构建参数:IncludePathInHash
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
class RawFileBuildParameters : BuildParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 文件哈希值计算包含路径信息
|
||||||
|
/// </summary>
|
||||||
|
public bool IncludePathInHash = false;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#671) 新增扩展工具,可以生成空的包裹内置资源目录文件。
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public class CreateEmptyCatalogWindow : EditorWindow
|
||||||
|
```
|
||||||
|
|
||||||
|
- (#694) 新增资源清理方式:ClearBundleFilesByLocations
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public enum EFileClearMode
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 清理指定地址的文件
|
||||||
|
/// 说明:需要指定参数,可选:string, string[], List<string>
|
||||||
|
/// </summary>
|
||||||
|
ClearBundleFilesByLocations,
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## [2.3.17] - 2025-10-30
|
## [2.3.17] - 2025-10-30
|
||||||
|
|
||||||
**非常重要**:修复了#627优化导致的资源清单CRC值为空的问题。
|
**非常重要**:修复了#627优化导致的资源清单CRC值为空的问题。
|
||||||
@@ -16,10 +67,6 @@ All notable changes to this package will be documented in this file.
|
|||||||
|
|
||||||
影响范围:所有版本!
|
影响范围:所有版本!
|
||||||
|
|
||||||
### Improvements
|
|
||||||
|
|
||||||
- 重构并统一了资源清单的反序列化逻辑。
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- (#645) 修复了着色器变种收集工具,在极端情况下变种收集不完整的问题。
|
- (#645) 修复了着色器变种收集工具,在极端情况下变种收集不完整的问题。
|
||||||
@@ -29,6 +76,7 @@ All notable changes to this package will be documented in this file.
|
|||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|
||||||
|
- 重构并统一了资源清单的反序列化逻辑。
|
||||||
- (#650) 解决互相依赖的资源包无法卸载的问题。需要开启宏定义:YOOASSET_EXPERIMENTAL
|
- (#650) 解决互相依赖的资源包无法卸载的问题。需要开启宏定义:YOOASSET_EXPERIMENTAL
|
||||||
- (#655) 优化了初始化的时候,缓存文件搜索效率。安卓平台性能提升1倍,IOS平台性能提升3倍。
|
- (#655) 优化了初始化的时候,缓存文件搜索效率。安卓平台性能提升1倍,IOS平台性能提升3倍。
|
||||||
|
|
||||||
|
|||||||
@@ -261,14 +261,14 @@ namespace YooAsset.Editor
|
|||||||
catch (System.Exception e)
|
catch (System.Exception e)
|
||||||
{
|
{
|
||||||
_reportCombiner = null;
|
_reportCombiner = null;
|
||||||
_titleLabel.text = "导入报告失败!";
|
_titleLabel.text = "Failed to import report!";
|
||||||
_descLabel.text = e.Message;
|
_descLabel.text = e.Message;
|
||||||
UnityEngine.Debug.LogError(e.StackTrace);
|
UnityEngine.Debug.LogError(e.StackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void FixAllBtn_clicked()
|
private void FixAllBtn_clicked()
|
||||||
{
|
{
|
||||||
if (EditorUtility.DisplayDialog("提示", "修复全部资源(排除白名单和隐藏元素)", "Yes", "No"))
|
if (EditorUtility.DisplayDialog("Info", "Fix all resources (excluding whitelist and hidden elements)", "Yes", "No"))
|
||||||
{
|
{
|
||||||
if (_reportCombiner != null)
|
if (_reportCombiner != null)
|
||||||
_reportCombiner.FixAll();
|
_reportCombiner.FixAll();
|
||||||
@@ -276,7 +276,7 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
private void FixSelectBtn_clicked()
|
private void FixSelectBtn_clicked()
|
||||||
{
|
{
|
||||||
if (EditorUtility.DisplayDialog("提示", "修复勾选资源(包含白名单和隐藏元素)", "Yes", "No"))
|
if (EditorUtility.DisplayDialog("Info", "Fix selected resources (including whitelist and hidden elements)", "Yes", "No"))
|
||||||
{
|
{
|
||||||
if (_reportCombiner != null)
|
if (_reportCombiner != null)
|
||||||
_reportCombiner.FixSelect();
|
_reportCombiner.FixSelect();
|
||||||
@@ -302,7 +302,7 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
private void ExportFilesBtn_clicked()
|
private void ExportFilesBtn_clicked()
|
||||||
{
|
{
|
||||||
string selectFolderPath = EditorUtility.OpenFolderPanel("导入所有选中资源", EditorTools.GetProjectPath(), string.Empty);
|
string selectFolderPath = EditorUtility.OpenFolderPanel("Export all selected resources", EditorTools.GetProjectPath(), string.Empty);
|
||||||
if (string.IsNullOrEmpty(selectFolderPath) == false)
|
if (string.IsNullOrEmpty(selectFolderPath) == false)
|
||||||
{
|
{
|
||||||
if (_reportCombiner != null)
|
if (_reportCombiner != null)
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
private void ScanAllBtn_clicked()
|
private void ScanAllBtn_clicked()
|
||||||
{
|
{
|
||||||
if (EditorUtility.DisplayDialog("提示", $"开始全面扫描!", "Yes", "No"))
|
if (EditorUtility.DisplayDialog("Info", $"Start full scan!", "Yes", "No"))
|
||||||
{
|
{
|
||||||
string searchKeyWord = _scannerSearchField.value;
|
string searchKeyWord = _scannerSearchField.value;
|
||||||
AssetArtScannerSettingData.ScanAll(searchKeyWord);
|
AssetArtScannerSettingData.ScanAll(searchKeyWord);
|
||||||
@@ -248,7 +248,7 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogWarning("全面扫描已经取消");
|
Debug.LogWarning("Full scan has been canceled.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void ScanBtn_clicked()
|
private void ScanBtn_clicked()
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
bundleInfo.PackageUnityHash = GetUnityHash(bundleInfo, context);
|
bundleInfo.PackageUnityHash = GetUnityHash(bundleInfo, context);
|
||||||
bundleInfo.PackageUnityCRC = GetUnityCRC(bundleInfo, context);
|
bundleInfo.PackageUnityCRC = GetUnityCRC(bundleInfo, context);
|
||||||
bundleInfo.PackageFileHash = GetBundleFileHash(bundleInfo, buildParametersContext);
|
bundleInfo.PackageFileHash = GetBundleFileHash(bundleInfo, context);
|
||||||
bundleInfo.PackageFileCRC = GetBundleFileCRC(bundleInfo, buildParametersContext);
|
bundleInfo.PackageFileCRC = GetBundleFileCRC(bundleInfo, context);
|
||||||
bundleInfo.PackageFileSize = GetBundleFileSize(bundleInfo, buildParametersContext);
|
bundleInfo.PackageFileSize = GetBundleFileSize(bundleInfo, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4.更新补丁包输出的文件路径
|
// 4.更新补丁包输出的文件路径
|
||||||
@@ -62,8 +62,8 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
protected abstract string GetUnityHash(BuildBundleInfo bundleInfo, BuildContext context);
|
protected abstract string GetUnityHash(BuildBundleInfo bundleInfo, BuildContext context);
|
||||||
protected abstract uint GetUnityCRC(BuildBundleInfo bundleInfo, BuildContext context);
|
protected abstract uint GetUnityCRC(BuildBundleInfo bundleInfo, BuildContext context);
|
||||||
protected abstract string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext);
|
protected abstract string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildContext context);
|
||||||
protected abstract uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext);
|
protected abstract uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildContext context);
|
||||||
protected abstract long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext);
|
protected abstract long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildContext context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,17 +40,17 @@ namespace YooAsset.Editor
|
|||||||
throw new Exception(message);
|
throw new Exception(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected override string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileMD5(filePath);
|
return HashUtility.FileMD5(filePath);
|
||||||
}
|
}
|
||||||
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileCRC32Value(filePath);
|
return HashUtility.FileCRC32Value(filePath);
|
||||||
}
|
}
|
||||||
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return FileUtility.GetFileSize(filePath);
|
return FileUtility.GetFileSize(filePath);
|
||||||
|
|||||||
@@ -19,16 +19,16 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
protected override string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return GetFilePathTempHash(filePath);
|
return GetFilePathTempHash(filePath);
|
||||||
}
|
}
|
||||||
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
return GetBundleTempSize(bundleInfo);
|
return GetBundleTempSize(bundleInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,27 +15,55 @@ namespace YooAsset.Editor
|
|||||||
|
|
||||||
protected override string GetUnityHash(BuildBundleInfo bundleInfo, BuildContext context)
|
protected override string GetUnityHash(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
||||||
return HashUtility.FileMD5(filePath);
|
var rawFileBuildParameters = buildParametersContext.Parameters as RawFileBuildParameters;
|
||||||
|
if (rawFileBuildParameters.IncludePathInHash)
|
||||||
|
{
|
||||||
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
|
return GetFileMD5IncludePath(filePath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
|
return HashUtility.FileMD5(filePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
protected override uint GetUnityCRC(BuildBundleInfo bundleInfo, BuildContext context)
|
protected override uint GetUnityCRC(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
protected override string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
|
||||||
return HashUtility.FileMD5(filePath);
|
var rawFileBuildParameters = buildParametersContext.Parameters as RawFileBuildParameters;
|
||||||
|
if (rawFileBuildParameters.IncludePathInHash)
|
||||||
|
{
|
||||||
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
|
return GetFileMD5IncludePath(filePath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
|
return HashUtility.FileMD5(filePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileCRC32Value(filePath);
|
return HashUtility.FileCRC32Value(filePath);
|
||||||
}
|
}
|
||||||
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return FileUtility.GetFileSize(filePath);
|
return FileUtility.GetFileSize(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetFileMD5IncludePath(string filePath)
|
||||||
|
{
|
||||||
|
string pathHash = HashUtility.StringMD5(filePath.ToLowerInvariant());
|
||||||
|
string contentHash = HashUtility.FileMD5(filePath);
|
||||||
|
string combined = pathHash + contentHash;
|
||||||
|
return HashUtility.StringMD5(combined);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,5 +6,9 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
public class RawFileBuildParameters : BuildParameters
|
public class RawFileBuildParameters : BuildParameters
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 文件哈希值计算包含路径信息
|
||||||
|
/// </summary>
|
||||||
|
public bool IncludePathInHash = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,17 +40,17 @@ namespace YooAsset.Editor
|
|||||||
throw new Exception(message);
|
throw new Exception(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected override string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override string GetBundleFileHash(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileMD5(filePath);
|
return HashUtility.FileMD5(filePath);
|
||||||
}
|
}
|
||||||
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override uint GetBundleFileCRC(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return HashUtility.FileCRC32Value(filePath);
|
return HashUtility.FileCRC32Value(filePath);
|
||||||
}
|
}
|
||||||
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildParametersContext buildParametersContext)
|
protected override long GetBundleFileSize(BuildBundleInfo bundleInfo, BuildContext context)
|
||||||
{
|
{
|
||||||
string filePath = bundleInfo.PackageSourceFilePath;
|
string filePath = bundleInfo.PackageSourceFilePath;
|
||||||
return FileUtility.GetFileSize(filePath);
|
return FileUtility.GetFileSize(filePath);
|
||||||
|
|||||||
@@ -82,14 +82,14 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
private void BuildButton_clicked()
|
private void BuildButton_clicked()
|
||||||
{
|
{
|
||||||
if (EditorUtility.DisplayDialog("提示", $"开始构建资源包[{PackageName}]!", "Yes", "No"))
|
if (EditorUtility.DisplayDialog("Info", $"Start building resource package [{PackageName}]!", "Yes", "No"))
|
||||||
{
|
{
|
||||||
EditorTools.ClearUnityConsole();
|
EditorTools.ClearUnityConsole();
|
||||||
EditorApplication.delayCall += ExecuteBuild;
|
EditorApplication.delayCall += ExecuteBuild;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogWarning("[Build] 打包已经取消");
|
Debug.LogWarning("[Build] Packaging has been canceled.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
private void BuildButton_clicked()
|
private void BuildButton_clicked()
|
||||||
{
|
{
|
||||||
if (EditorUtility.DisplayDialog("提示", $"开始构建资源包[{PackageName}]!", "Yes", "No"))
|
if (EditorUtility.DisplayDialog("Info", $"Start building resource package [{PackageName}]!", "Yes", "No"))
|
||||||
{
|
{
|
||||||
EditorTools.ClearUnityConsole();
|
EditorTools.ClearUnityConsole();
|
||||||
EditorApplication.delayCall += ExecuteBuild;
|
EditorApplication.delayCall += ExecuteBuild;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogWarning("[Build] 打包已经取消");
|
Debug.LogWarning("[Build] Packaging has been canceled.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,14 +77,14 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
private void BuildButton_clicked()
|
private void BuildButton_clicked()
|
||||||
{
|
{
|
||||||
if (EditorUtility.DisplayDialog("提示", $"开始构建资源包[{PackageName}]!", "Yes", "No"))
|
if (EditorUtility.DisplayDialog("Info", $"Start building resource package [{PackageName}]!", "Yes", "No"))
|
||||||
{
|
{
|
||||||
EditorTools.ClearUnityConsole();
|
EditorTools.ClearUnityConsole();
|
||||||
EditorApplication.delayCall += ExecuteBuild;
|
EditorApplication.delayCall += ExecuteBuild;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogWarning("[Build] 打包已经取消");
|
Debug.LogWarning("[Build] Packaging has been canceled.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,14 +82,14 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
private void BuildButton_clicked()
|
private void BuildButton_clicked()
|
||||||
{
|
{
|
||||||
if (EditorUtility.DisplayDialog("提示", $"开始构建资源包[{PackageName}]!", "Yes", "No"))
|
if (EditorUtility.DisplayDialog("Info", $"Start building resource package [{PackageName}]!", "Yes", "No"))
|
||||||
{
|
{
|
||||||
EditorTools.ClearUnityConsole();
|
EditorTools.ClearUnityConsole();
|
||||||
EditorApplication.delayCall += ExecuteBuild;
|
EditorApplication.delayCall += ExecuteBuild;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogWarning("[Build] 打包已经取消");
|
Debug.LogWarning("[Build] Packaging has been canceled.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<ui:VisualElement name="PackageContainer" style="width: 200px; flex-grow: 0; background-color: rgb(67, 67, 67); border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px;">
|
<ui:VisualElement name="PackageContainer" style="width: 200px; flex-grow: 0; background-color: rgb(67, 67, 67); border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px;">
|
||||||
<ui:Label text="Packages" display-tooltip-when-elided="true" name="PackageTitle" style="background-color: rgb(89, 89, 89); -unity-text-align: upper-center; -unity-font-style: bold; border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px; font-size: 12px;" />
|
<ui:Label text="Packages" display-tooltip-when-elided="true" name="PackageTitle" style="background-color: rgb(89, 89, 89); -unity-text-align: upper-center; -unity-font-style: bold; border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; border-bottom-width: 5px; font-size: 12px;" />
|
||||||
<ui:ListView focusable="true" name="PackageListView" item-height="20" virtualization-method="DynamicHeight" reorderable="true" reorder-mode="Animated" style="flex-grow: 1;" />
|
<ui:ListView focusable="true" name="PackageListView" item-height="20" virtualization-method="DynamicHeight" reorderable="true" reorder-mode="Animated" style="flex-grow: 1;" />
|
||||||
<ui:VisualElement name="PackageAddContainer" style="height: 20px; flex-direction: row; justify-content: center;">
|
<ui:VisualElement name="PackageAddContainer" style="height: 20px; flex-direction: row; justify-content: center; flex-shrink: 0;">
|
||||||
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
||||||
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<ui:TextField picking-mode="Ignore" label="Package Name" name="PackageName" style="flex-direction: column;" />
|
<ui:TextField picking-mode="Ignore" label="Package Name" name="PackageName" style="flex-direction: column;" />
|
||||||
<ui:TextField picking-mode="Ignore" label="Package Desc" name="PackageDesc" style="flex-direction: column;" />
|
<ui:TextField picking-mode="Ignore" label="Package Desc" name="PackageDesc" style="flex-direction: column;" />
|
||||||
<ui:ListView focusable="true" name="GroupListView" item-height="20" virtualization-method="DynamicHeight" reorderable="true" reorder-mode="Animated" style="flex-grow: 1;" />
|
<ui:ListView focusable="true" name="GroupListView" item-height="20" virtualization-method="DynamicHeight" reorderable="true" reorder-mode="Animated" style="flex-grow: 1;" />
|
||||||
<ui:VisualElement name="GroupAddContainer" style="height: 20px; flex-direction: row; justify-content: center;">
|
<ui:VisualElement name="GroupAddContainer" style="height: 20px; flex-direction: row; justify-content: center; flex-shrink: 0;">
|
||||||
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
<ui:Button text=" - " display-tooltip-when-elided="true" name="RemoveBtn" />
|
||||||
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
<ui:Button text=" + " display-tooltip-when-elided="true" name="AddBtn" />
|
||||||
</ui:VisualElement>
|
</ui:VisualElement>
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ namespace YooAsset.Editor
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
ClearDatabase(true);
|
|
||||||
Debug.LogError($"Failed to load cache database : {ex.Message}");
|
Debug.LogError($"Failed to load cache database : {ex.Message}");
|
||||||
|
ClearDatabase(true);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -169,7 +169,8 @@ namespace YooAsset.Editor
|
|||||||
File.Delete(_databaseFilePath);
|
File.Delete(_databaseFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
_database.Clear();
|
if (_database != null)
|
||||||
|
_database.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ namespace YooAsset.Editor
|
|||||||
Texture,
|
Texture,
|
||||||
RenderTexture,
|
RenderTexture,
|
||||||
VideoClip,
|
VideoClip,
|
||||||
|
PlayableAsset,
|
||||||
|
TimelineAsset
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -118,6 +118,34 @@ namespace YooAsset
|
|||||||
Debug.Log($"Succeed to save catalog file : {binaryFilePath}");
|
Debug.Log($"Succeed to save catalog file : {binaryFilePath}");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生成空的包裹内置资源目录文件
|
||||||
|
/// </summary>
|
||||||
|
public static bool CreateEmptyCatalogFile(string packageName, string packageVersion, string outputPath)
|
||||||
|
{
|
||||||
|
// 创建内置清单实例
|
||||||
|
var buildinFileCatalog = new DefaultBuildinFileCatalog();
|
||||||
|
buildinFileCatalog.FileVersion = CatalogDefine.FileVersion;
|
||||||
|
buildinFileCatalog.PackageName = packageName;
|
||||||
|
buildinFileCatalog.PackageVersion = packageVersion;
|
||||||
|
|
||||||
|
// 创建输出文件
|
||||||
|
string jsonFilePath = $"{outputPath}/{DefaultBuildinFileSystemDefine.BuildinCatalogJsonFileName}";
|
||||||
|
if (File.Exists(jsonFilePath))
|
||||||
|
File.Delete(jsonFilePath);
|
||||||
|
SerializeToJson(jsonFilePath, buildinFileCatalog);
|
||||||
|
|
||||||
|
// 创建输出文件
|
||||||
|
string binaryFilePath = $"{outputPath}/{DefaultBuildinFileSystemDefine.BuildinCatalogBinaryFileName}";
|
||||||
|
if (File.Exists(binaryFilePath))
|
||||||
|
File.Delete(binaryFilePath);
|
||||||
|
SerializeToBinary(binaryFilePath, buildinFileCatalog);
|
||||||
|
|
||||||
|
UnityEditor.AssetDatabase.Refresh();
|
||||||
|
Debug.Log($"Succeed to save catalog file : {binaryFilePath}");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ namespace YooAsset
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string CopyBuildinPackageManifestDestRoot { private set; get; }
|
public string CopyBuildinPackageManifestDestRoot { private set; get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自定义参数:解压文件系统的根目录
|
||||||
|
/// </summary>
|
||||||
|
public string UnpackFileSystemRoot { private set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:解密服务接口的实例类
|
/// 自定义参数:解密服务接口的实例类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -190,6 +195,10 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
CopyBuildinPackageManifestDestRoot = (string)value;
|
CopyBuildinPackageManifestDestRoot = (string)value;
|
||||||
}
|
}
|
||||||
|
else if (name == FileSystemParametersDefine.UNPACK_FILE_SYSTEM_ROOT)
|
||||||
|
{
|
||||||
|
UnpackFileSystemRoot = (string)value;
|
||||||
|
}
|
||||||
else if (name == FileSystemParametersDefine.DECRYPTION_SERVICES)
|
else if (name == FileSystemParametersDefine.DECRYPTION_SERVICES)
|
||||||
{
|
{
|
||||||
DecryptionServices = (IDecryptionServices)value;
|
DecryptionServices = (IDecryptionServices)value;
|
||||||
@@ -226,7 +235,7 @@ namespace YooAsset
|
|||||||
_unpackFileSystem.SetParameter(FileSystemParametersDefine.APPEND_FILE_EXTENSION, AppendFileExtension);
|
_unpackFileSystem.SetParameter(FileSystemParametersDefine.APPEND_FILE_EXTENSION, AppendFileExtension);
|
||||||
_unpackFileSystem.SetParameter(FileSystemParametersDefine.DECRYPTION_SERVICES, DecryptionServices);
|
_unpackFileSystem.SetParameter(FileSystemParametersDefine.DECRYPTION_SERVICES, DecryptionServices);
|
||||||
_unpackFileSystem.SetParameter(FileSystemParametersDefine.COPY_LOCAL_FILE_SERVICES, CopyLocalFileServices);
|
_unpackFileSystem.SetParameter(FileSystemParametersDefine.COPY_LOCAL_FILE_SERVICES, CopyLocalFileServices);
|
||||||
_unpackFileSystem.OnCreate(packageName, null);
|
_unpackFileSystem.OnCreate(packageName, UnpackFileSystemRoot);
|
||||||
}
|
}
|
||||||
public virtual void OnDestroy()
|
public virtual void OnDestroy()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -158,6 +158,11 @@ namespace YooAsset
|
|||||||
var operation = new ClearUnusedCacheBundleFilesOperation(this, manifest);
|
var operation = new ClearUnusedCacheBundleFilesOperation(this, manifest);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
else if (options.ClearMode == EFileClearMode.ClearBundleFilesByLocations.ToString())
|
||||||
|
{
|
||||||
|
var operation = new ClearCacheBundleFilesByLocationsOperaiton(this, manifest, options.ClearParam);
|
||||||
|
return operation;
|
||||||
|
}
|
||||||
else if (options.ClearMode == EFileClearMode.ClearBundleFilesByTags.ToString())
|
else if (options.ClearMode == EFileClearMode.ClearBundleFilesByTags.ToString())
|
||||||
{
|
{
|
||||||
var operation = new ClearCacheBundleFilesByTagsOperaiton(this, manifest, options.ClearParam);
|
var operation = new ClearCacheBundleFilesByTagsOperaiton(this, manifest, options.ClearParam);
|
||||||
|
|||||||
@@ -0,0 +1,142 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace YooAsset
|
||||||
|
{
|
||||||
|
internal class ClearCacheBundleFilesByLocationsOperaiton : FSClearCacheFilesOperation
|
||||||
|
{
|
||||||
|
private enum ESteps
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
CheckManifest,
|
||||||
|
CheckArgs,
|
||||||
|
GetClearCacheFiles,
|
||||||
|
ClearFilterCacheFiles,
|
||||||
|
Done,
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly DefaultCacheFileSystem _fileSystem;
|
||||||
|
private readonly PackageManifest _manifest;
|
||||||
|
private readonly object _clearParam;
|
||||||
|
private string[] _locations;
|
||||||
|
private List<string> _clearBundleGUIDs;
|
||||||
|
private int _clearFileTotalCount = 0;
|
||||||
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
|
internal ClearCacheBundleFilesByLocationsOperaiton(DefaultCacheFileSystem fileSystem, PackageManifest manifest, object clearParam)
|
||||||
|
{
|
||||||
|
_fileSystem = fileSystem;
|
||||||
|
_manifest = manifest;
|
||||||
|
_clearParam = clearParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal override void InternalStart()
|
||||||
|
{
|
||||||
|
_steps = ESteps.CheckManifest;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal override void InternalUpdate()
|
||||||
|
{
|
||||||
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_steps == ESteps.CheckManifest)
|
||||||
|
{
|
||||||
|
if (_manifest == null)
|
||||||
|
{
|
||||||
|
_steps = ESteps.Done;
|
||||||
|
Status = EOperationStatus.Failed;
|
||||||
|
Error = "Can not found active package manifest !";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_steps = ESteps.CheckArgs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_steps == ESteps.CheckArgs)
|
||||||
|
{
|
||||||
|
if (_clearParam == null)
|
||||||
|
{
|
||||||
|
_steps = ESteps.Done;
|
||||||
|
Status = EOperationStatus.Failed;
|
||||||
|
Error = "Clear param is null !";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_clearParam is string)
|
||||||
|
{
|
||||||
|
_locations = new string[] { _clearParam as string };
|
||||||
|
}
|
||||||
|
else if (_clearParam is List<string>)
|
||||||
|
{
|
||||||
|
var tempList = _clearParam as List<string>;
|
||||||
|
_locations = tempList.ToArray();
|
||||||
|
}
|
||||||
|
else if (_clearParam is string[])
|
||||||
|
{
|
||||||
|
_locations = _clearParam as string[];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_steps = ESteps.Done;
|
||||||
|
Status = EOperationStatus.Failed;
|
||||||
|
Error = $"Invalid clear param : {_clearParam.GetType().FullName}";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_steps = ESteps.GetClearCacheFiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_steps == ESteps.GetClearCacheFiles)
|
||||||
|
{
|
||||||
|
_clearBundleGUIDs = GetBundleGUIDsByLocation();
|
||||||
|
_clearFileTotalCount = _clearBundleGUIDs.Count;
|
||||||
|
_steps = ESteps.ClearFilterCacheFiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_steps == ESteps.ClearFilterCacheFiles)
|
||||||
|
{
|
||||||
|
for (int i = _clearBundleGUIDs.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
string bundleGUID = _clearBundleGUIDs[i];
|
||||||
|
_fileSystem.DeleteCacheBundleFile(bundleGUID);
|
||||||
|
_clearBundleGUIDs.RemoveAt(i);
|
||||||
|
if (OperationSystem.IsBusy)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_clearFileTotalCount == 0)
|
||||||
|
Progress = 1.0f;
|
||||||
|
else
|
||||||
|
Progress = 1.0f - (_clearBundleGUIDs.Count / _clearFileTotalCount);
|
||||||
|
|
||||||
|
if (_clearBundleGUIDs.Count == 0)
|
||||||
|
{
|
||||||
|
_steps = ESteps.Done;
|
||||||
|
Status = EOperationStatus.Succeed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<string> GetBundleGUIDsByLocation()
|
||||||
|
{
|
||||||
|
List<string> result = new List<string>(_locations.Length);
|
||||||
|
|
||||||
|
foreach (var location in _locations)
|
||||||
|
{
|
||||||
|
string assetPath = _manifest.TryMappingToAssetPath(location);
|
||||||
|
if (_manifest.TryGetPackageAsset(assetPath, out PackageAsset packageAsset))
|
||||||
|
{
|
||||||
|
PackageBundle bundle = _manifest.GetMainPackageBundle(packageAsset.BundleID);
|
||||||
|
|
||||||
|
if (bundle != null)
|
||||||
|
{
|
||||||
|
result.Add(bundle.BundleGUID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0be6ffd570645bf4a95126958a8e8a86
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -20,7 +20,7 @@ namespace YooAsset
|
|||||||
private UnityDownloadFileOperation _unityDownloadFileOp;
|
private UnityDownloadFileOperation _unityDownloadFileOp;
|
||||||
|
|
||||||
protected int _requestCount = 0;
|
protected int _requestCount = 0;
|
||||||
protected float _tryAgainTimer;
|
protected float _tryAgainTimer = 0;
|
||||||
protected int _failedTryAgain;
|
protected int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace YooAsset
|
|||||||
protected UnityVirtualBundleRequestOperation _unityDownloadFileOp;
|
protected UnityVirtualBundleRequestOperation _unityDownloadFileOp;
|
||||||
|
|
||||||
protected int _requestCount = 0;
|
protected int _requestCount = 0;
|
||||||
protected float _tryAgainTimer;
|
protected float _tryAgainTimer = 0;
|
||||||
protected int _failedTryAgain;
|
protected int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ namespace YooAsset
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
ClearUnusedBundleFiles,
|
ClearUnusedBundleFiles,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理指定地址的文件
|
||||||
|
/// 说明:需要指定参数,可选:string, string[], List<string>
|
||||||
|
/// </summary>
|
||||||
|
ClearBundleFilesByLocations,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 清理指定标签的文件
|
/// 清理指定标签的文件
|
||||||
/// 说明:需要指定参数,可选:string, string[], List<string>
|
/// 说明:需要指定参数,可选:string, string[], List<string>
|
||||||
|
|||||||
@@ -26,5 +26,6 @@ namespace YooAsset
|
|||||||
public const string COPY_BUILDIN_PACKAGE_MANIFEST = "COPY_BUILDIN_PACKAGE_MANIFEST";
|
public const string COPY_BUILDIN_PACKAGE_MANIFEST = "COPY_BUILDIN_PACKAGE_MANIFEST";
|
||||||
public const string COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT = "COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT";
|
public const string COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT = "COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT";
|
||||||
public const string COPY_LOCAL_FILE_SERVICES = "COPY_LOCAL_FILE_SERVICES";
|
public const string COPY_LOCAL_FILE_SERVICES = "COPY_LOCAL_FILE_SERVICES";
|
||||||
|
public const string UNPACK_FILE_SYSTEM_ROOT = "UNPACK_FILE_SYSTEM_ROOT";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,15 +18,16 @@ namespace YooAsset
|
|||||||
private readonly IWebDecryptionServices _decryptionServices;
|
private readonly IWebDecryptionServices _decryptionServices;
|
||||||
private UnityWebDataRequestOperation _unityWebDataRequestOp;
|
private UnityWebDataRequestOperation _unityWebDataRequestOp;
|
||||||
|
|
||||||
protected int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
protected float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
protected int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
internal LoadWebEncryptAssetBundleOperation(PackageBundle bundle, DownloadFileOptions options, IWebDecryptionServices decryptionServices)
|
internal LoadWebEncryptAssetBundleOperation(PackageBundle bundle, DownloadFileOptions options, IWebDecryptionServices decryptionServices)
|
||||||
{
|
{
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
_decryptionServices = decryptionServices;
|
_decryptionServices = decryptionServices;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ namespace YooAsset
|
|||||||
private readonly bool _disableUnityWebCache;
|
private readonly bool _disableUnityWebCache;
|
||||||
private UnityAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
private UnityAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
||||||
|
|
||||||
protected int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
protected float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
protected int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
_disableUnityWebCache = disableUnityWebCache;
|
_disableUnityWebCache = disableUnityWebCache;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
using System.IO;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
|
namespace YooAsset.Editor
|
||||||
|
{
|
||||||
|
public class CreateEmptyCatalogWindow : EditorWindow
|
||||||
|
{
|
||||||
|
static CreateEmptyCatalogWindow _thisInstance;
|
||||||
|
|
||||||
|
[MenuItem("Tools/空清单生成工具(Catalog)", false, 102)]
|
||||||
|
static void ShowWindow()
|
||||||
|
{
|
||||||
|
if (_thisInstance == null)
|
||||||
|
{
|
||||||
|
_thisInstance = EditorWindow.GetWindow(typeof(CreateEmptyCatalogWindow), false, "空清单生成工具", true) as CreateEmptyCatalogWindow;
|
||||||
|
_thisInstance.minSize = new Vector2(800, 600);
|
||||||
|
}
|
||||||
|
_thisInstance.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _packageName = string.Empty;
|
||||||
|
|
||||||
|
private void OnGUI()
|
||||||
|
{
|
||||||
|
GUILayout.Space(10);
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
_packageName = EditorGUILayout.TextField("Package Name", _packageName);
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(_packageName) == false)
|
||||||
|
{
|
||||||
|
if (GUILayout.Button("生成空的Catalog文件", GUILayout.MaxWidth(150)))
|
||||||
|
{
|
||||||
|
string outputPath = EditorTools.OpenFolderPanel("输出目录", "Assets/");
|
||||||
|
if (string.IsNullOrEmpty(outputPath) == false)
|
||||||
|
{
|
||||||
|
CreateEmptyCatalogFile(outputPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateEmptyCatalogFile(string outputPath)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bool result = CatalogTools.CreateEmptyCatalogFile(_packageName, string.Empty, outputPath);
|
||||||
|
if (result == false)
|
||||||
|
{
|
||||||
|
Debug.LogError($"Create package {_packageName} catalog file failed ! See the detail error in console !");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (System.Exception ex)
|
||||||
|
{
|
||||||
|
Debug.LogError($"Create package {_packageName} catalog file failed ! {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 211aadfc630b2ec419d5efce05e8aabe
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -10,7 +10,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
static PackageComparatorWindow _thisInstance;
|
static PackageComparatorWindow _thisInstance;
|
||||||
|
|
||||||
[MenuItem("Tools/补丁包比对工具", false, 102)]
|
[MenuItem("Tools/补丁包比对工具", false, 103)]
|
||||||
static void ShowWindow()
|
static void ShowWindow()
|
||||||
{
|
{
|
||||||
if (_thisInstance == null)
|
if (_thisInstance == null)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace YooAsset.Editor
|
|||||||
{
|
{
|
||||||
static PackageImporterWindow _thisInstance;
|
static PackageImporterWindow _thisInstance;
|
||||||
|
|
||||||
[MenuItem("Tools/补丁包导入工具", false, 101)]
|
[MenuItem("Tools/补丁包导入工具", false, 104)]
|
||||||
static void ShowWindow()
|
static void ShowWindow()
|
||||||
{
|
{
|
||||||
if (_thisInstance == null)
|
if (_thisInstance == null)
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ internal class APFSDownloadFileOperation : FSDownloadFileOperation
|
|||||||
private readonly AlipayFileSystem _fileSystem;
|
private readonly AlipayFileSystem _fileSystem;
|
||||||
private readonly DownloadFileOptions _options;
|
private readonly DownloadFileOptions _options;
|
||||||
private UnityWebCacheRequestOperation _webCacheRequestOp;
|
private UnityWebCacheRequestOperation _webCacheRequestOp;
|
||||||
|
|
||||||
private int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
private float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
private int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ internal class APFSDownloadFileOperation : FSDownloadFileOperation
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace YooAsset
|
|||||||
private UnityAlipayAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
private UnityAlipayAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
||||||
|
|
||||||
private int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
private float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
private int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
@@ -29,6 +29,7 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ internal class TPFSDownloadFileOperation : FSDownloadFileOperation
|
|||||||
private readonly TaptapFileSystem _fileSystem;
|
private readonly TaptapFileSystem _fileSystem;
|
||||||
private readonly DownloadFileOptions _options;
|
private readonly DownloadFileOptions _options;
|
||||||
private UnityWebCacheRequestOperation _webCacheRequestOp;
|
private UnityWebCacheRequestOperation _webCacheRequestOp;
|
||||||
|
|
||||||
private int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
private float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
private int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ internal class TPFSDownloadFileOperation : FSDownloadFileOperation
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace YooAsset
|
|||||||
private UnityTaptapAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
private UnityTaptapAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
||||||
|
|
||||||
private int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
private float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
private int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ internal class TTFSDownloadFileOperation : FSDownloadFileOperation
|
|||||||
private readonly TiktokFileSystem _fileSystem;
|
private readonly TiktokFileSystem _fileSystem;
|
||||||
private readonly DownloadFileOptions _options;
|
private readonly DownloadFileOptions _options;
|
||||||
private UnityWebCacheRequestOperation _webCacheRequestOp;
|
private UnityWebCacheRequestOperation _webCacheRequestOp;
|
||||||
|
|
||||||
private int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
private float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
private int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ internal class TTFSDownloadFileOperation : FSDownloadFileOperation
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace YooAsset
|
|||||||
private UnityTiktokAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
private UnityTiktokAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
||||||
|
|
||||||
private int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
private float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
private int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ internal class WXFSDownloadFileOperation : FSDownloadFileOperation
|
|||||||
private readonly WechatFileSystem _fileSystem;
|
private readonly WechatFileSystem _fileSystem;
|
||||||
private readonly DownloadFileOptions _options;
|
private readonly DownloadFileOptions _options;
|
||||||
private UnityWebCacheRequestOperation _webCacheRequestOp;
|
private UnityWebCacheRequestOperation _webCacheRequestOp;
|
||||||
|
|
||||||
private int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
private float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
private int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ internal class WXFSDownloadFileOperation : FSDownloadFileOperation
|
|||||||
{
|
{
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace YooAsset
|
|||||||
private UnityWechatAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
private UnityWechatAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
||||||
|
|
||||||
private int _requestCount = 0;
|
private int _requestCount = 0;
|
||||||
private float _tryAgainTimer;
|
private float _tryAgainTimer = 0;
|
||||||
private int _failedTryAgain;
|
private int _failedTryAgain;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_bundle = bundle;
|
_bundle = bundle;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_failedTryAgain = options.FailedTryAgain;
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,19 +94,19 @@ namespace Cysharp.Threading.Tasks
|
|||||||
switch (handle)
|
switch (handle)
|
||||||
{
|
{
|
||||||
case AssetHandle asset_handle:
|
case AssetHandle asset_handle:
|
||||||
asset_handle.Completed += result.continuationAction;
|
asset_handle.Completed += result._continuationAction;
|
||||||
break;
|
break;
|
||||||
case SceneHandle scene_handle:
|
case SceneHandle scene_handle:
|
||||||
scene_handle.Completed += result.continuationAction;
|
scene_handle.Completed += result._continuationAction;
|
||||||
break;
|
break;
|
||||||
case SubAssetsHandle sub_asset_handle:
|
case SubAssetsHandle sub_asset_handle:
|
||||||
sub_asset_handle.Completed += result.continuationAction;
|
sub_asset_handle.Completed += result._continuationAction;
|
||||||
break;
|
break;
|
||||||
case RawFileHandle raw_file_handle:
|
case RawFileHandle raw_file_handle:
|
||||||
raw_file_handle.Completed += result.continuationAction;
|
raw_file_handle.Completed += result._continuationAction;
|
||||||
break;
|
break;
|
||||||
case AllAssetsHandle all_assets_handle:
|
case AllAssetsHandle all_assets_handle:
|
||||||
all_assets_handle.Completed += result.continuationAction;
|
all_assets_handle.Completed += result._continuationAction;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "com.tuyoogame.yooasset",
|
"name": "com.tuyoogame.yooasset",
|
||||||
"displayName": "YooAsset",
|
"displayName": "YooAsset",
|
||||||
"version": "2.3.17",
|
"version": "2.3.18",
|
||||||
"unity": "2019.4",
|
"unity": "2019.4",
|
||||||
"description": "unity3d resources management system.",
|
"description": "unity3d resources management system.",
|
||||||
"author": {
|
"author": {
|
||||||
|
|||||||
Reference in New Issue
Block a user