pull/229/head
hevinci 2023-12-22 10:24:41 +08:00
parent 2332765932
commit 82b2a5cc20
3 changed files with 15 additions and 3 deletions

View File

@ -88,7 +88,7 @@ namespace YooAsset
internal abstract void InternalOnUpdate(); internal abstract void InternalOnUpdate();
internal virtual void InternalOnAbort() { } internal virtual void InternalOnAbort() { }
internal void Init(string packageName) internal void SetPackageName(string packageName)
{ {
PackageName = packageName; PackageName = packageName;
} }

View File

@ -134,7 +134,16 @@ namespace YooAsset
public static void StartOperation(string packageName, AsyncOperationBase operation) public static void StartOperation(string packageName, AsyncOperationBase operation)
{ {
_newList.Add(operation); _newList.Add(operation);
operation.Init(packageName); operation.SetPackageName(packageName);
operation.SetStart();
}
/// <summary>
/// 开始处理异步操作类
/// </summary>
public static void StartOperation(AsyncOperationBase operation)
{
_newList.Add(operation);
operation.SetStart(); operation.SetStart();
} }
} }

View File

@ -95,6 +95,9 @@ namespace YooAsset
_failedTryAgain = failedTryAgain; _failedTryAgain = failedTryAgain;
_timeout = timeout; _timeout = timeout;
// 设置包裹名称 (fix #210)
SetPackageName(packageName);
// 统计下载信息 // 统计下载信息
CalculatDownloaderInfo(); CalculatDownloaderInfo();
} }
@ -269,7 +272,7 @@ namespace YooAsset
{ {
if (_steps == ESteps.None) if (_steps == ESteps.None)
{ {
OperationSystem.StartOperation(_packageName, this); OperationSystem.StartOperation(this);
} }
} }