mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-29 20:48:47 +00:00
Compare commits
5 Commits
abb087b02e
...
5da8c6baf8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5da8c6baf8 | ||
|
|
33356cb270 | ||
|
|
4b6a8ca406 | ||
|
|
c8e45a6cae | ||
|
|
1fbc9d26a6 |
@@ -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倍。
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成空的包裹内置自由目录文件
|
/// 生成空的包裹内置资源目录文件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool CreateEmptyCatalogFile(string packageName, string packageVersion, string outputPath)
|
public static bool CreateEmptyCatalogFile(string packageName, string packageVersion, string outputPath)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,8 +73,10 @@ namespace YooAsset
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:初始化的时候缓存文件校验最大并发数
|
/// 自定义参数:初始化的时候缓存文件校验最大并发数
|
||||||
|
/// 默认值:32(推荐范围 1-128)
|
||||||
|
/// 说明:过大的值可能导致线程池任务过多,影响系统稳定性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int FileVerifyMaxConcurrency { private set; get; } = int.MaxValue;
|
public int FileVerifyMaxConcurrency { private set; get; } = 32;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:数据文件追加文件格式
|
/// 自定义参数:数据文件追加文件格式
|
||||||
@@ -88,13 +90,17 @@ namespace YooAsset
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:最大并发连接数
|
/// 自定义参数:最大并发连接数
|
||||||
|
/// 默认值:10(推荐范围 1-32)
|
||||||
|
/// 说明:过大的并发数可能被服务器限流,也会增加本地资源消耗
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int DownloadMaxConcurrency { private set; get; } = int.MaxValue;
|
public int DownloadMaxConcurrency { private set; get; } = 10;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:每帧发起的最大请求数
|
/// 自定义参数:每帧发起的最大请求数
|
||||||
|
/// 默认值:5(推荐范围 1-10)
|
||||||
|
/// 说明:避免单帧发起过多请求导致卡顿
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int DownloadMaxRequestPerFrame { private set; get; } = int.MaxValue;
|
public int DownloadMaxRequestPerFrame { private set; get; } = 5;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:下载任务的看门狗机制监控时间
|
/// 自定义参数:下载任务的看门狗机制监控时间
|
||||||
@@ -242,7 +248,14 @@ namespace YooAsset
|
|||||||
else if (name == FileSystemParametersDefine.FILE_VERIFY_MAX_CONCURRENCY)
|
else if (name == FileSystemParametersDefine.FILE_VERIFY_MAX_CONCURRENCY)
|
||||||
{
|
{
|
||||||
int convertValue = Convert.ToInt32(value);
|
int convertValue = Convert.ToInt32(value);
|
||||||
FileVerifyMaxConcurrency = Mathf.Clamp(convertValue, 1, int.MaxValue);
|
if (convertValue > 256)
|
||||||
|
{
|
||||||
|
YooLogger.Warning($"FILE_VERIFY_MAX_CONCURRENCY value {convertValue} is too large, clamped to 256. Recommended range: 1 - 128.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 限制在合理范围内:1-256
|
||||||
|
// 超过 256 的并发数对于文件验证来说没有意义,反而会增加线程池压力
|
||||||
|
FileVerifyMaxConcurrency = Mathf.Clamp(convertValue, 1, 256);
|
||||||
}
|
}
|
||||||
else if (name == FileSystemParametersDefine.APPEND_FILE_EXTENSION)
|
else if (name == FileSystemParametersDefine.APPEND_FILE_EXTENSION)
|
||||||
{
|
{
|
||||||
@@ -255,12 +268,22 @@ namespace YooAsset
|
|||||||
else if (name == FileSystemParametersDefine.DOWNLOAD_MAX_CONCURRENCY)
|
else if (name == FileSystemParametersDefine.DOWNLOAD_MAX_CONCURRENCY)
|
||||||
{
|
{
|
||||||
int convertValue = Convert.ToInt32(value);
|
int convertValue = Convert.ToInt32(value);
|
||||||
DownloadMaxConcurrency = Mathf.Clamp(convertValue, 1, int.MaxValue);
|
if (convertValue > 64)
|
||||||
|
{
|
||||||
|
YooLogger.Warning($"DOWNLOAD_MAX_CONCURRENCY value {convertValue} is too large, clamped to 64. Recommended range: 1 - 32.");
|
||||||
|
}
|
||||||
|
|
||||||
|
DownloadMaxConcurrency = Mathf.Clamp(convertValue, 1, 64);
|
||||||
}
|
}
|
||||||
else if (name == FileSystemParametersDefine.DOWNLOAD_MAX_REQUEST_PER_FRAME)
|
else if (name == FileSystemParametersDefine.DOWNLOAD_MAX_REQUEST_PER_FRAME)
|
||||||
{
|
{
|
||||||
int convertValue = Convert.ToInt32(value);
|
int convertValue = Convert.ToInt32(value);
|
||||||
DownloadMaxRequestPerFrame = Mathf.Clamp(convertValue, 1, int.MaxValue);
|
if (convertValue > 20)
|
||||||
|
{
|
||||||
|
YooLogger.Warning($"DOWNLOAD_MAX_REQUEST_PER_FRAME value {convertValue} is too large, clamped to 20. Recommended range: 1 - 10.");
|
||||||
|
}
|
||||||
|
|
||||||
|
DownloadMaxRequestPerFrame = Mathf.Clamp(convertValue, 1, 20);
|
||||||
}
|
}
|
||||||
else if (name == FileSystemParametersDefine.DOWNLOAD_WATCH_DOG_TIME)
|
else if (name == FileSystemParametersDefine.DOWNLOAD_WATCH_DOG_TIME)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -188,13 +188,21 @@ namespace YooAsset
|
|||||||
// 结束记录
|
// 结束记录
|
||||||
DebugEndRecording();
|
DebugEndRecording();
|
||||||
|
|
||||||
//注意:如果完成回调内发生异常,会导致Task无限期等待
|
try
|
||||||
|
{
|
||||||
_callback?.Invoke(this);
|
_callback?.Invoke(this);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
YooLogger.Error($"Exception in completion callback: {ex}");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
if (_taskCompletionSource != null)
|
if (_taskCompletionSource != null)
|
||||||
_taskCompletionSource.TrySetResult(null);
|
_taskCompletionSource.TrySetResult(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 终止异步任务
|
/// 终止异步任务
|
||||||
|
|||||||
@@ -269,6 +269,7 @@ namespace YooAsset
|
|||||||
|
|
||||||
if (_resManager.UseWeakReferenceHandle)
|
if (_resManager.UseWeakReferenceHandle)
|
||||||
{
|
{
|
||||||
|
// TODO 高危风险:如果移除弱引用失败,会导致资源永远无法释放。
|
||||||
if (RemoveWeakReference(handle) == false)
|
if (RemoveWeakReference(handle) == false)
|
||||||
throw new System.Exception("Should never get here !");
|
throw new System.Exception("Should never get here !");
|
||||||
}
|
}
|
||||||
@@ -335,11 +336,18 @@ namespace YooAsset
|
|||||||
List<WeakReference<HandleBase>> tempers = _weakReferences.ToList();
|
List<WeakReference<HandleBase>> tempers = _weakReferences.ToList();
|
||||||
foreach (var weakRef in tempers)
|
foreach (var weakRef in tempers)
|
||||||
{
|
{
|
||||||
if (weakRef.TryGetTarget(out HandleBase target))
|
if (weakRef.TryGetTarget(out HandleBase handle))
|
||||||
{
|
{
|
||||||
if (target.IsValid)
|
if (handle.IsValid)
|
||||||
{
|
{
|
||||||
target.InvokeCallback();
|
try
|
||||||
|
{
|
||||||
|
handle.InvokeCallback();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
YooLogger.Error($"Exception in completion callback: {ex}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -350,9 +358,16 @@ namespace YooAsset
|
|||||||
foreach (var handle in tempers)
|
foreach (var handle in tempers)
|
||||||
{
|
{
|
||||||
if (handle.IsValid)
|
if (handle.IsValid)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
handle.InvokeCallback();
|
handle.InvokeCallback();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
YooLogger.Error($"Exception in completion callback: {ex}");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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