From 4c619778c31cfb989dd401a44bba200878f2b482 Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 13 Mar 2024 15:50:46 +0800 Subject: [PATCH] feat : support open harmony MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持华为鸿蒙系统 --- Assets/YooAsset/Runtime/CacheSystem/PersistentHelper.cs | 2 ++ Assets/YooAsset/Runtime/CacheSystem/PersistentManager.cs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Runtime/CacheSystem/PersistentHelper.cs b/Assets/YooAsset/Runtime/CacheSystem/PersistentHelper.cs index 52a6b7b..dd757a4 100644 --- a/Assets/YooAsset/Runtime/CacheSystem/PersistentHelper.cs +++ b/Assets/YooAsset/Runtime/CacheSystem/PersistentHelper.cs @@ -23,6 +23,8 @@ namespace YooAsset return new System.Uri(path).ToString(); #elif UNITY_STANDALONE return StringUtility.Format("file:///{0}", path); +#elif UNITY_OPENHARMONY + return path; #else return path; #endif diff --git a/Assets/YooAsset/Runtime/CacheSystem/PersistentManager.cs b/Assets/YooAsset/Runtime/CacheSystem/PersistentManager.cs index 3b93500..a970b9e 100644 --- a/Assets/YooAsset/Runtime/CacheSystem/PersistentManager.cs +++ b/Assets/YooAsset/Runtime/CacheSystem/PersistentManager.cs @@ -58,7 +58,12 @@ namespace YooAsset } private static string CreateDefaultBuildinRoot() { - return PathUtility.Combine(UnityEngine.Application.streamingAssetsPath, YooAssetSettingsData.Setting.DefaultYooFolderName); + string path = PathUtility.Combine(UnityEngine.Application.streamingAssetsPath, YooAssetSettingsData.Setting.DefaultYooFolderName); +#if UNITY_OPENHARMONY + return $"file://{path}"; +#else + return path; +#endif } private static string CreateDefaultSandboxRoot() {