From 92ac301716affe34a2e7fa18b1ba6882e844643a Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 13 Mar 2024 15:42:23 +0800 Subject: [PATCH] feat : support open harmony --- Assets/YooAsset/Runtime/CacheSystem/Persistent.cs | 7 ++++++- Assets/YooAsset/Runtime/CacheSystem/PersistentTools.cs | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Runtime/CacheSystem/Persistent.cs b/Assets/YooAsset/Runtime/CacheSystem/Persistent.cs index 8d96192d..56010d20 100644 --- a/Assets/YooAsset/Runtime/CacheSystem/Persistent.cs +++ b/Assets/YooAsset/Runtime/CacheSystem/Persistent.cs @@ -46,7 +46,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() { diff --git a/Assets/YooAsset/Runtime/CacheSystem/PersistentTools.cs b/Assets/YooAsset/Runtime/CacheSystem/PersistentTools.cs index f17127d0..4a2aefbd 100644 --- a/Assets/YooAsset/Runtime/CacheSystem/PersistentTools.cs +++ b/Assets/YooAsset/Runtime/CacheSystem/PersistentTools.cs @@ -47,6 +47,8 @@ namespace YooAsset return StringUtility.Format("file:///{0}", path); #elif UNITY_WEBGL return path; +#elif UNITY_OPENHARMONY + return path; #endif } }