From 3cbf891674348788fcb73587c8f4317bfb494ced Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 21 Jun 2022 17:21:37 +0800 Subject: [PATCH] Add GetAssetPath method. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加YooAssets.GetAssetPath方法 --- Assets/YooAsset/Runtime/YooAssets.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/YooAsset/Runtime/YooAssets.cs b/Assets/YooAsset/Runtime/YooAssets.cs index 32dbe86..9b8c325 100644 --- a/Assets/YooAsset/Runtime/YooAssets.cs +++ b/Assets/YooAsset/Runtime/YooAssets.cs @@ -426,6 +426,17 @@ namespace YooAsset DebugCheckInitialize(); return _bundleServices.GetAssetInfos(tags); } + + /// + /// 获取资源路径 + /// + /// 资源的定位地址 + /// 如果location地址无效,则返回空字符串 + public static string GetAssetPath(string location) + { + DebugCheckInitialize(); + return _locationServices.ConvertLocationToAssetPath(location); + } #endregion #region 场景加载