From ddda9e29dbed5dbe8e929f1d99f5cd8770727794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=86=A0=E5=B3=B0?= Date: Wed, 5 Mar 2025 17:39:33 +0800 Subject: [PATCH] fix #491 --- .../Runtime/Settings/YooAssetSettingsData.cs | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Assets/YooAsset/Runtime/Settings/YooAssetSettingsData.cs b/Assets/YooAsset/Runtime/Settings/YooAssetSettingsData.cs index 6e6dc05e..13ce8b80 100644 --- a/Assets/YooAsset/Runtime/Settings/YooAssetSettingsData.cs +++ b/Assets/YooAsset/Runtime/Settings/YooAssetSettingsData.cs @@ -3,10 +3,10 @@ using UnityEngine; namespace YooAsset { - internal static class YooAssetSettingsData + public static class YooAssetSettingsData { private static YooAssetSettings _setting = null; - public static YooAssetSettings Setting + internal static YooAssetSettings Setting { get { @@ -33,6 +33,15 @@ namespace YooAsset } } + + /// + /// 获取YooAsset文件夹名称 + /// + public static string GetDefaultYooFolderName() + { + return Setting.DefaultYooFolderName; + } + /// /// 获取构建报告文件名 /// @@ -92,7 +101,7 @@ namespace YooAsset /// /// 获取YOO的Resources目录的加载路径 /// - public static string GetYooResourcesLoadPath(string packageName, string fileName) + internal static string GetYooResourcesLoadPath(string packageName, string fileName) { if (string.IsNullOrEmpty(Setting.DefaultYooFolderName)) return PathUtility.Combine(packageName, fileName); @@ -103,7 +112,7 @@ namespace YooAsset /// /// 获取YOO的Resources目录的全路径 /// - public static string GetYooResourcesFullPath() + internal static string GetYooResourcesFullPath() { if (string.IsNullOrEmpty(Setting.DefaultYooFolderName)) return $"Assets/Resources"; @@ -114,7 +123,7 @@ namespace YooAsset /// /// 获取YOO的编辑器下缓存文件根目录 /// - public static string GetYooEditorCacheRoot() + internal static string GetYooEditorCacheRoot() { if (string.IsNullOrEmpty(Setting.DefaultYooFolderName)) { @@ -134,7 +143,7 @@ namespace YooAsset /// /// 获取YOO的PC平台缓存文件根目录 /// - public static string GetYooStandaloneWinCacheRoot() + internal static string GetYooStandaloneWinCacheRoot() { if (string.IsNullOrEmpty(Setting.DefaultYooFolderName)) return Application.dataPath; @@ -145,18 +154,18 @@ namespace YooAsset /// /// 获取YOO的Linux平台缓存文件根目录 /// - public static string GetYooStandaloneLinuxCacheRoot() + internal static string GetYooStandaloneLinuxCacheRoot() { if (string.IsNullOrEmpty(Setting.DefaultYooFolderName)) return Application.dataPath; else return PathUtility.Combine(Application.dataPath, Setting.DefaultYooFolderName); } - + /// /// 获取YOO的Mac平台缓存文件根目录 /// - public static string GetYooStandaloneMacCacheRoot() + internal static string GetYooStandaloneMacCacheRoot() { if (string.IsNullOrEmpty(Setting.DefaultYooFolderName)) return Application.persistentDataPath; @@ -167,7 +176,7 @@ namespace YooAsset /// /// 获取YOO的移动平台缓存文件根目录 /// - public static string GetYooMobileCacheRoot() + internal static string GetYooMobileCacheRoot() { if (string.IsNullOrEmpty(Setting.DefaultYooFolderName)) return Application.persistentDataPath; @@ -178,7 +187,7 @@ namespace YooAsset /// /// 获取YOO默认的缓存文件根目录 /// - public static string GetYooDefaultCacheRoot() + internal static string GetYooDefaultCacheRoot() { #if UNITY_EDITOR return GetYooEditorCacheRoot(); @@ -196,7 +205,7 @@ namespace YooAsset /// /// 获取YOO默认的内置文件根目录 /// - public static string GetYooDefaultBuildinRoot() + internal static string GetYooDefaultBuildinRoot() { if (string.IsNullOrEmpty(Setting.DefaultYooFolderName)) return Application.streamingAssetsPath;