Skip to content

Commit 358054d

Browse files
committed
[修复] YooAsset 版本适配
1 parent bfb05aa commit 358054d

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

Assets/Hotfix/Unity.HotFix.asmdef

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"DOTween.Runtime.Modules",
1313
"UniTask.Runtime",
1414
"YooAsset.Runtime",
15+
"YooAsset",
1516
"GameAnalytics.Runtime",
1617
"ProtoBuffer.Runtime",
1718
"MessagePack.Annotations",

Assets/Scripts/Framework/Procedure/HttpHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static Dictionary<string, object> GetBaseParams()
3030
DictionaryParams["Platform"] = PathHelper.GetPlatformName;
3131
#endif
3232
#else
33-
DictionaryParams["Platform"] = PathHelper.GetPlatformName;
33+
DictionaryParams["Platform"] = ApplicationHelper.PlatformName;
3434
#if UNITY_STANDALONE_WIN
3535
DictionaryParams["PackageName"] = Application.productName;
3636
#else

Assets/Scripts/Framework/Procedure/PatchUpdater/ProcedureCreateDownloader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void CreateDownloader(IFsm<IProcedureManager> procedureOwner)
3939
// 发现新更新文件后,挂起流程系统
4040
int totalDownloadCount = downloader.TotalDownloadCount;
4141
long totalDownloadBytes = downloader.TotalDownloadBytes;
42-
GameApp.Event.Fire(this, AssetFoundUpdateFilesEventArgs.Create(downloader.GetPackageName(), totalDownloadCount, totalDownloadBytes));
42+
GameApp.Event.Fire(this, AssetFoundUpdateFilesEventArgs.Create(downloader.PackageName, totalDownloadCount, totalDownloadBytes));
4343
ChangeState<ProcedureDownloadWebFiles>(procedureOwner);
4444
}
4545
}

Assets/Scripts/Framework/Procedure/PatchUpdater/ProcedureDownloadWebFiles.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ private IEnumerator BeginDownload(IFsm<IProcedureManager> procedureOwner)
2525

2626

2727
// 注册下载回调
28-
void DownloaderOnDownloadErrorCallback(string packageName, string name, string error)
28+
void DownloaderOnDownloadErrorCallback(DownloadErrorData data)
2929
{
30-
GameApp.Event.Fire(this, AssetWebFileDownloadFailedEventArgs.Create(packageName, name, error));
30+
GameApp.Event.Fire(this, AssetWebFileDownloadFailedEventArgs.Create(data.PackageName, data.FileName, data.ErrorInfo));
3131
ChangeState<ProcedureCreateDownloader>(procedureOwner);
3232
}
3333

34-
downloader.OnDownloadErrorCallback = DownloaderOnDownloadErrorCallback;
35-
downloader.OnDownloadProgressCallback = OnDownloadProgressCallback;
34+
downloader.DownloadErrorCallback = DownloaderOnDownloadErrorCallback;
35+
downloader.DownloadUpdateCallback = OnDownloadProgressCallback;
3636
downloader.BeginDownload();
3737
yield return downloader;
3838

@@ -45,9 +45,9 @@ void DownloaderOnDownloadErrorCallback(string packageName, string name, string e
4545
ChangeState<ProcedurePatchDone>(procedureOwner);
4646
}
4747

48-
private void OnDownloadProgressCallback(string packageName, int totalDownloadCount, int currentDownloadCount, long totalDownloadBytes, long currentDownloadBytes)
48+
private void OnDownloadProgressCallback(DownloadUpdateData data)
4949
{
50-
GameApp.Event.Fire(this, AssetDownloadProgressUpdateEventArgs.Create(packageName, totalDownloadCount, currentDownloadCount, totalDownloadBytes, currentDownloadBytes));
50+
GameApp.Event.Fire(this, AssetDownloadProgressUpdateEventArgs.Create(data.PackageName, data.TotalDownloadCount, data.CurrentDownloadCount, data.TotalDownloadBytes, data.CurrentDownloadBytes));
5151
}
5252
}
5353
}

Assets/Scripts/Unity.Startup.asmdef

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"GameFrameX.Web.Runtime",
77
"GameFrameX.GlobalConfig.Runtime",
88
"YooAsset.Runtime",
9+
"YooAsset",
910
"UniTask.Runtime",
1011
"FairyGUI.Runtime",
1112
"BlankGetChannel.Runtime",

0 commit comments

Comments
 (0)