From af822add2cb76b44652115c1bf0a99ad3751b5a1 Mon Sep 17 00:00:00 2001 From: Weekend <872285171@qq.com> Date: Wed, 15 Nov 2023 15:14:47 +0800 Subject: [PATCH] =?UTF-8?q?add:=E4=B8=8B=E8=BD=BD=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=8C=85=E4=B8=AD=E6=8C=87=E5=AE=9A=E5=9C=B0=E5=9D=80=E7=9A=84?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/ResourceModule/ResourceModule.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/UnityProject/Assets/TEngine/Runtime/Modules/ResourceModule/ResourceModule.cs b/UnityProject/Assets/TEngine/Runtime/Modules/ResourceModule/ResourceModule.cs index 919a1d62..e5d6fa91 100644 --- a/UnityProject/Assets/TEngine/Runtime/Modules/ResourceModule/ResourceModule.cs +++ b/UnityProject/Assets/TEngine/Runtime/Modules/ResourceModule/ResourceModule.cs @@ -306,6 +306,27 @@ namespace TEngine } } + /// + /// 创建资源下载器,用于下载当前资源版本指定地址的资源文件。 + /// + /// 资源地址 + /// 指定资源包的名称。不传使用默认资源包 + public ResourceDownloaderOperation CreateResourceDownloader(string location, string packageName = "") + { + if (string.IsNullOrEmpty(packageName)) + { + var package = YooAssets.GetPackage(this.packageName); + Downloader = package.CreateResourceDownloader(location, downloadingMaxNum, failedTryAgain); + return Downloader; + } + else + { + var package = YooAssets.GetPackage(packageName); + Downloader = package.CreateResourceDownloader(location, downloadingMaxNum, failedTryAgain); + return Downloader; + } + } + /// /// 清理包裹未使用的缓存文件。 ///