using UnityEngine; namespace YooAsset { internal static class YooAssetSettingsData { private static YooAssetSettings _setting = null; public static YooAssetSettings Setting { get { if (_setting == null) LoadSettingData(); return _setting; } } /// /// 加载配置文件 /// private static void LoadSettingData() { _setting = Resources.Load("YooAssetSettings"); if (_setting == null) { YooLogger.Log("YooAsset use default settings."); _setting = ScriptableObject.CreateInstance(); } else { YooLogger.Log("YooAsset use user settings."); } } /// /// 获取构建报告文件名 /// public static string GetReportFileName(string packageName, string packageVersion) { return $"{YooAssetSettings.ReportFileName}_{packageName}_{packageVersion}.json"; } /// /// 获取清单文件完整名称 /// public static string GetManifestBinaryFileName(string packageName, string packageVersion) { return $"{Setting.ManifestFileName}_{packageName}_{packageVersion}.bytes"; } /// /// 获取清单文件完整名称 /// public static string GetManifestJsonFileName(string packageName, string packageVersion) { return $"{Setting.ManifestFileName}_{packageName}_{packageVersion}.json"; } /// /// 获取包裹的哈希文件完整名称 /// public static string GetPackageHashFileName(string packageName, string packageVersion) { return $"{Setting.ManifestFileName}_{packageName}_{packageVersion}.hash"; } /// /// 获取包裹的版本文件完整名称 /// public static string GetPackageVersionFileName(string packageName) { return $"{Setting.ManifestFileName}_{packageName}.version"; } } }