From 79a9763555409c757088db5d75bb6aa19b82d80c Mon Sep 17 00:00:00 2001 From: Nocye Date: Thu, 22 Jun 2023 20:04:23 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=B9=E6=B3=95,=E8=8E=B7=E5=8F=96=E8=BF=98=E6=B2=A1?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E7=9A=84=E5=B8=A6tag=E5=8E=9F=E7=94=9F?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlayMode/EditorSimulateModeImpl.cs | 5 ++++ .../PlayMode/HostPlayModeImpl.cs | 27 +++++++++++++++++++ .../PlayMode/OfflinePlayModeImpl.cs | 5 ++++ .../Runtime/PackageSystem/ResourcePackage.cs | 13 +++++++++ .../Services/Internal/IPlayModeServices.cs | 1 + 5 files changed, 51 insertions(+) diff --git a/Assets/YooAsset/Runtime/PackageSystem/PlayMode/EditorSimulateModeImpl.cs b/Assets/YooAsset/Runtime/PackageSystem/PlayMode/EditorSimulateModeImpl.cs index 82acded..57d7da8 100644 --- a/Assets/YooAsset/Runtime/PackageSystem/PlayMode/EditorSimulateModeImpl.cs +++ b/Assets/YooAsset/Runtime/PackageSystem/PlayMode/EditorSimulateModeImpl.cs @@ -138,6 +138,11 @@ namespace YooAsset return result; } + public List GetNeedDownloadTagsRawFiles(string[] tags) + { + return new List(); + } + #endregion } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/PackageSystem/PlayMode/HostPlayModeImpl.cs b/Assets/YooAsset/Runtime/PackageSystem/PlayMode/HostPlayModeImpl.cs index f88bce1..1e6deff 100644 --- a/Assets/YooAsset/Runtime/PackageSystem/PlayMode/HostPlayModeImpl.cs +++ b/Assets/YooAsset/Runtime/PackageSystem/PlayMode/HostPlayModeImpl.cs @@ -377,6 +377,33 @@ namespace YooAsset return result; } + public List GetNeedDownloadTagsRawFiles(string[] tags) + { + List neetDownloadList = new List(200); + foreach (PackageBundle bundle in _activeManifest.BundleList) + { + if (IsCachedPackageBundle(bundle)) + { + continue; + } + + if (IsBuildinPackageBundle(bundle)) + { + continue; + } + + if (!bundle.HasAnyTags()) + { + continue; + } + + bundle.HasTag(tags); + neetDownloadList.Add(bundle); + } + + return neetDownloadList; + } + #endregion } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/PackageSystem/PlayMode/OfflinePlayModeImpl.cs b/Assets/YooAsset/Runtime/PackageSystem/PlayMode/OfflinePlayModeImpl.cs index c19f841..680e5fc 100644 --- a/Assets/YooAsset/Runtime/PackageSystem/PlayMode/OfflinePlayModeImpl.cs +++ b/Assets/YooAsset/Runtime/PackageSystem/PlayMode/OfflinePlayModeImpl.cs @@ -139,6 +139,11 @@ namespace YooAsset return new List(); } + public List GetNeedDownloadTagsRawFiles(string[] tags) + { + return new List(); + } + #endregion } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/PackageSystem/ResourcePackage.cs b/Assets/YooAsset/Runtime/PackageSystem/ResourcePackage.cs index 7182387..4be848f 100644 --- a/Assets/YooAsset/Runtime/PackageSystem/ResourcePackage.cs +++ b/Assets/YooAsset/Runtime/PackageSystem/ResourcePackage.cs @@ -866,6 +866,19 @@ namespace YooAsset OperationSystem.StartOperation(operation); return operation; } + + public long GetNeedDownloadTagsRawFileSize(string[] tags) + { + DebugCheckInitialize(); + var list=_playModeServices.GetNeedDownloadTagsRawFiles(tags); + long size = 0; + foreach (PackageBundle packageBundle in list) + { + size += packageBundle.FileSize; + } + + return size; + } #endregion } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/Services/Internal/IPlayModeServices.cs b/Assets/YooAsset/Runtime/Services/Internal/IPlayModeServices.cs index 042de3d..7b8d58f 100644 --- a/Assets/YooAsset/Runtime/Services/Internal/IPlayModeServices.cs +++ b/Assets/YooAsset/Runtime/Services/Internal/IPlayModeServices.cs @@ -40,5 +40,6 @@ namespace YooAsset ResourceUnpackerOperation CreateResourceUnpackerByTags(string[] tags, int upackingMaxNumber, int failedTryAgain, int timeout); List GetCachedTagsRawFiles(string[] tags); + List GetNeedDownloadTagsRawFiles(string[] tags); } } \ No newline at end of file