mirror of https://github.com/tuyoogame/YooAsset
Compare commits
No commits in common. "9fb7f8bbfe0ac22d29603e54564e98a4d014e7b0" and "b0dc829b04d7d33cb0fb7e3131c1a4d8fd87e978" have entirely different histories.
9fb7f8bbfe
...
b0dc829b04
|
@ -2,62 +2,6 @@
|
||||||
|
|
||||||
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.7] - 2025-04-01
|
|
||||||
|
|
||||||
### Improvements
|
|
||||||
|
|
||||||
- (#526) 运行时资源清单的哈希值验证兼容了MD5和CRC32两种方式。
|
|
||||||
- (#515) 优化了资源路径大小写不敏感的逻辑代码,减少字符串操作产生的GC。
|
|
||||||
- (#523) UnloadUnusedAssetsOperation方法支持了分帧处理。
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- (#520) 修复了UWP平台获取WWW加载路径未适配的问题。
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- 新增了文件系统初始化参数:INSTALL_CLEAR_MODE
|
|
||||||
|
|
||||||
```csharp
|
|
||||||
/// <summary>
|
|
||||||
/// 覆盖安装清理模式
|
|
||||||
/// </summary>
|
|
||||||
public enum EOverwriteInstallClearMode
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 不做任何处理
|
|
||||||
/// </summary>
|
|
||||||
None = 0,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 清理所有缓存文件(包含资源文件和清单文件)
|
|
||||||
/// </summary>
|
|
||||||
ClearAllCacheFiles = 1,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 清理所有缓存的资源文件
|
|
||||||
/// </summary>
|
|
||||||
ClearAllBundleFiles = 2,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 清理所有缓存的清单文件
|
|
||||||
/// </summary>
|
|
||||||
ClearAllManifestFiles = 3,
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
- 新增了初始化参数:BundleLoadingMaxConcurrency
|
|
||||||
|
|
||||||
```csharp
|
|
||||||
public abstract class InitializeParameters
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 同时加载Bundle文件的最大并发数
|
|
||||||
/// </summary>
|
|
||||||
public int BundleLoadingMaxConcurrency = int.MaxValue;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## [2.3.6] - 2025-03-25
|
## [2.3.6] - 2025-03-25
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|
|
@ -38,10 +38,6 @@ namespace YooAsset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class InitializeParameters
|
public abstract class InitializeParameters
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 同时加载Bundle文件的最大并发数
|
|
||||||
/// </summary>
|
|
||||||
public int BundleLoadingMaxConcurrency = int.MaxValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -9,8 +9,7 @@ namespace YooAsset
|
||||||
private enum ESteps
|
private enum ESteps
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
CheckConcurrency,
|
LoadFile,
|
||||||
LoadBundleFile,
|
|
||||||
Done,
|
Done,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,32 +57,17 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.CheckConcurrency;
|
_steps = ESteps.LoadFile;
|
||||||
}
|
}
|
||||||
internal override void InternalUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_steps == ESteps.CheckConcurrency)
|
if (_steps == ESteps.LoadFile)
|
||||||
{
|
|
||||||
if (IsWaitForAsyncComplete)
|
|
||||||
{
|
|
||||||
_steps = ESteps.LoadBundleFile;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_resourceManager.BundleLoadingIsBusy())
|
|
||||||
return;
|
|
||||||
_steps = ESteps.LoadBundleFile;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_steps == ESteps.LoadBundleFile)
|
|
||||||
{
|
{
|
||||||
if (_loadBundleOp == null)
|
if (_loadBundleOp == null)
|
||||||
{
|
{
|
||||||
_resourceManager.BundleLoadingCounter++;
|
|
||||||
_loadBundleOp = LoadBundleInfo.LoadBundleFile();
|
_loadBundleOp = LoadBundleInfo.LoadBundleFile();
|
||||||
_loadBundleOp.StartOperation();
|
_loadBundleOp.StartOperation();
|
||||||
AddChildOperation(_loadBundleOp);
|
AddChildOperation(_loadBundleOp);
|
||||||
|
@ -119,9 +103,6 @@ namespace YooAsset
|
||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
Error = _loadBundleOp.Error;
|
Error = _loadBundleOp.Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 统计计数减少
|
|
||||||
_resourceManager.BundleLoadingCounter--;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal override void InternalWaitForAsyncComplete()
|
internal override void InternalWaitForAsyncComplete()
|
||||||
|
|
|
@ -15,7 +15,6 @@ namespace YooAsset
|
||||||
|
|
||||||
private readonly ResourceManager _resManager;
|
private readonly ResourceManager _resManager;
|
||||||
private readonly int _loopCount;
|
private readonly int _loopCount;
|
||||||
private int _loopCounter = 0;
|
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
internal UnloadUnusedAssetsOperation(ResourceManager resourceManager, int loopCount)
|
internal UnloadUnusedAssetsOperation(ResourceManager resourceManager, int loopCount)
|
||||||
|
@ -26,7 +25,6 @@ namespace YooAsset
|
||||||
internal override void InternalStart()
|
internal override void InternalStart()
|
||||||
{
|
{
|
||||||
_steps = ESteps.UnloadUnused;
|
_steps = ESteps.UnloadUnused;
|
||||||
_loopCounter = _loopCount;
|
|
||||||
}
|
}
|
||||||
internal override void InternalUpdate()
|
internal override void InternalUpdate()
|
||||||
{
|
{
|
||||||
|
@ -35,23 +33,13 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.UnloadUnused)
|
if (_steps == ESteps.UnloadUnused)
|
||||||
{
|
{
|
||||||
while (_loopCounter > 0)
|
for (int i = 0; i < _loopCount; i++)
|
||||||
{
|
{
|
||||||
_loopCounter--;
|
|
||||||
LoopUnloadUnused();
|
LoopUnloadUnused();
|
||||||
|
|
||||||
if (IsWaitForAsyncComplete == false)
|
|
||||||
{
|
|
||||||
if (OperationSystem.IsBusy)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_loopCounter <= 0)
|
_steps = ESteps.Done;
|
||||||
{
|
Status = EOperationStatus.Succeed;
|
||||||
_steps = ESteps.Done;
|
|
||||||
Status = EOperationStatus.Succeed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal override void InternalWaitForAsyncComplete()
|
internal override void InternalWaitForAsyncComplete()
|
||||||
|
|
|
@ -14,7 +14,6 @@ namespace YooAsset
|
||||||
internal readonly List<SceneHandle> SceneHandles = new List<SceneHandle>(100);
|
internal readonly List<SceneHandle> SceneHandles = new List<SceneHandle>(100);
|
||||||
private long _sceneCreateIndex = 0;
|
private long _sceneCreateIndex = 0;
|
||||||
private IBundleQuery _bundleQuery;
|
private IBundleQuery _bundleQuery;
|
||||||
private int _bundleLoadingMaxConcurrency;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属包裹
|
/// 所属包裹
|
||||||
|
@ -26,11 +25,6 @@ namespace YooAsset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool LockLoadOperation = false;
|
public bool LockLoadOperation = false;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 统计正在加载的Bundle文件数量
|
|
||||||
/// </summary>
|
|
||||||
public int BundleLoadingCounter = 0;
|
|
||||||
|
|
||||||
|
|
||||||
public ResourceManager(string packageName)
|
public ResourceManager(string packageName)
|
||||||
{
|
{
|
||||||
|
@ -40,9 +34,8 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化
|
/// 初始化
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Initialize(InitializeParameters parameters, IBundleQuery bundleServices)
|
public void Initialize(IBundleQuery bundleServices)
|
||||||
{
|
{
|
||||||
_bundleLoadingMaxConcurrency = parameters.BundleLoadingMaxConcurrency;
|
|
||||||
_bundleQuery = bundleServices;
|
_bundleQuery = bundleServices;
|
||||||
SceneManager.sceneUnloaded += OnSceneUnloaded;
|
SceneManager.sceneUnloaded += OnSceneUnloaded;
|
||||||
}
|
}
|
||||||
|
@ -317,10 +310,6 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
return LoaderDic.Count > 0;
|
return LoaderDic.Count > 0;
|
||||||
}
|
}
|
||||||
internal bool BundleLoadingIsBusy()
|
|
||||||
{
|
|
||||||
return BundleLoadingCounter >= _bundleLoadingMaxConcurrency;
|
|
||||||
}
|
|
||||||
|
|
||||||
private LoadBundleFileOperation CreateBundleFileLoaderInternal(BundleInfo bundleInfo)
|
private LoadBundleFileOperation CreateBundleFileLoaderInternal(BundleInfo bundleInfo)
|
||||||
{
|
{
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace YooAsset
|
||||||
var playModeImpl = new PlayModeImpl(PackageName, _playMode);
|
var playModeImpl = new PlayModeImpl(PackageName, _playMode);
|
||||||
_bundleQuery = playModeImpl;
|
_bundleQuery = playModeImpl;
|
||||||
_playModeImpl = playModeImpl;
|
_playModeImpl = playModeImpl;
|
||||||
_resourceManager.Initialize(parameters, _bundleQuery);
|
_resourceManager.Initialize(_bundleQuery);
|
||||||
|
|
||||||
// 初始化资源系统
|
// 初始化资源系统
|
||||||
InitializationOperation initializeOperation;
|
InitializationOperation initializeOperation;
|
||||||
|
@ -162,10 +162,6 @@ namespace YooAsset
|
||||||
throw new Exception($"Editor simulate mode only support unity editor.");
|
throw new Exception($"Editor simulate mode only support unity editor.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// 检测初始化参数
|
|
||||||
if (parameters.BundleLoadingMaxConcurrency <= 0)
|
|
||||||
throw new Exception($"{nameof(parameters.BundleLoadingMaxConcurrency)} value must be greater than zero.");
|
|
||||||
|
|
||||||
// 鉴定运行模式
|
// 鉴定运行模式
|
||||||
if (parameters is EditorSimulateModeParameters)
|
if (parameters is EditorSimulateModeParameters)
|
||||||
_playMode = EPlayMode.EditorSimulateMode;
|
_playMode = EPlayMode.EditorSimulateMode;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "com.tuyoogame.yooasset",
|
"name": "com.tuyoogame.yooasset",
|
||||||
"displayName": "YooAsset",
|
"displayName": "YooAsset",
|
||||||
"version": "2.3.7",
|
"version": "2.3.6",
|
||||||
"unity": "2019.4",
|
"unity": "2019.4",
|
||||||
"description": "unity3d resources management system.",
|
"description": "unity3d resources management system.",
|
||||||
"author": {
|
"author": {
|
||||||
|
|
Loading…
Reference in New Issue