From 30854e4b93a02784fde9530ea4c974436924c2f7 Mon Sep 17 00:00:00 2001 From: hevinci Date: Mon, 25 Sep 2023 18:25:34 +0800 Subject: [PATCH] update asset settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 可以自定义设置参数DefaultYooFolderName --- .../AssetBundleBuilder/AssetBundleBuilderHelper.cs | 2 +- Assets/YooAsset/Runtime/CacheSystem/Persistent.cs | 8 ++++---- Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs | 9 ++++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderHelper.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderHelper.cs index 35d30b4..f1f6bf1 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderHelper.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderHelper.cs @@ -22,7 +22,7 @@ namespace YooAsset.Editor /// public static string GetDefaultStreamingAssetsRoot() { - return $"{Application.dataPath}/StreamingAssets/{YooAssetSettings.DefaultYooFolderName}/"; + return $"{Application.dataPath}/StreamingAssets/{YooAssetSettingsData.Setting.DefaultYooFolderName}/"; } } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/CacheSystem/Persistent.cs b/Assets/YooAsset/Runtime/CacheSystem/Persistent.cs index b4ab6a1..8d96192 100644 --- a/Assets/YooAsset/Runtime/CacheSystem/Persistent.cs +++ b/Assets/YooAsset/Runtime/CacheSystem/Persistent.cs @@ -46,7 +46,7 @@ namespace YooAsset } private static string CreateDefaultBuildinRoot() { - return PathUtility.Combine(UnityEngine.Application.streamingAssetsPath, YooAssetSettings.DefaultYooFolderName); + return PathUtility.Combine(UnityEngine.Application.streamingAssetsPath, YooAssetSettingsData.Setting.DefaultYooFolderName); } private static string CreateDefaultSandboxRoot() { @@ -54,11 +54,11 @@ namespace YooAsset // 注意:为了方便调试查看,编辑器下把存储目录放到项目里。 string projectPath = Path.GetDirectoryName(UnityEngine.Application.dataPath); projectPath = PathUtility.RegularPath(projectPath); - return PathUtility.Combine(projectPath, YooAssetSettings.DefaultYooFolderName); + return PathUtility.Combine(projectPath, YooAssetSettingsData.Setting.DefaultYooFolderName); #elif UNITY_STANDALONE - return PathUtility.Combine(UnityEngine.Application.dataPath, YooAssetSettings.DefaultYooFolderName); + return PathUtility.Combine(UnityEngine.Application.dataPath, YooAssetSettingsData.Setting.DefaultYooFolderName); #else - return PathUtility.Combine(UnityEngine.Application.persistentDataPath, YooAssetSettings.DefaultYooFolderName); + return PathUtility.Combine(UnityEngine.Application.persistentDataPath, YooAssetSettingsData.Setting.DefaultYooFolderName); #endif } diff --git a/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs b/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs index 559bc39..43f540f 100644 --- a/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs +++ b/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs @@ -10,6 +10,10 @@ namespace YooAsset /// public string ManifestFileName = "PackageManifest"; + /// + /// 默认的YooAsset文件夹名称 + /// + public string DefaultYooFolderName = "yoo"; /// /// 清单文件头标记 @@ -37,11 +41,6 @@ namespace YooAsset /// public const string CacheBundleInfoFileName = "__info"; - /// - /// 默认的YooAsset文件夹名称 - /// - public const string DefaultYooFolderName = "yoo"; - /// /// 缓存的资源文件的文件夹名称 ///