diff --git a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs index 6e7c693..e2f8c96 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs @@ -341,7 +341,6 @@ namespace YooAsset foreach (var provider in _providers) { DebugProviderInfo providerInfo = new DebugProviderInfo(); - providerInfo.PackageName = BundleServices.GetPackageName(); providerInfo.AssetPath = provider.MainAssetInfo.AssetPath; providerInfo.SpawnScene = provider.SpawnScene; providerInfo.SpawnTime = provider.SpawnTime; diff --git a/Assets/YooAsset/Runtime/DiagnosticSystem/DebugBundleInfo.cs b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugBundleInfo.cs index 8da6223..34af51e 100644 --- a/Assets/YooAsset/Runtime/DiagnosticSystem/DebugBundleInfo.cs +++ b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugBundleInfo.cs @@ -1,10 +1,17 @@ using System; +using System.Collections; +using System.Collections.Generic; namespace YooAsset { [Serializable] - internal class DebugBundleInfo + internal class DebugBundleInfo : IComparer, IComparable { + /// + /// 包裹名 + /// + public string PackageName { set; get; } + /// /// 资源包名称 /// @@ -19,5 +26,14 @@ namespace YooAsset /// 加载状态 /// public int Status; + + public int CompareTo(DebugBundleInfo other) + { + return Compare(this, other); + } + public int Compare(DebugBundleInfo a, DebugBundleInfo b) + { + return string.CompareOrdinal(a.BundleName, b.BundleName); + } } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/DiagnosticSystem/DebugPackageData.cs b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugPackageData.cs new file mode 100644 index 0000000..12ac443 --- /dev/null +++ b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugPackageData.cs @@ -0,0 +1,21 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; + +namespace YooAsset +{ + [Serializable] + internal class DebugPackageData + { + /// + /// 包裹名称 + /// + public string PackageName; + + /// + /// 调试数据列表 + /// + public List ProviderInfos = new List(1000); + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/DiagnosticSystem/DebugPackageData.cs.meta b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugPackageData.cs.meta new file mode 100644 index 0000000..e008f65 --- /dev/null +++ b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugPackageData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 583d0c3e5520c6748b2aeacd209cf8b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Runtime/DiagnosticSystem/DebugProviderInfo.cs b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugProviderInfo.cs index bcfd52e..6aea281 100644 --- a/Assets/YooAsset/Runtime/DiagnosticSystem/DebugProviderInfo.cs +++ b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugProviderInfo.cs @@ -8,9 +8,9 @@ namespace YooAsset internal class DebugProviderInfo : IComparer, IComparable { /// - /// 所属的资源包裹 + /// 包裹名 /// - public string PackageName; + public string PackageName { set; get; } /// /// 资源对象路径 diff --git a/Assets/YooAsset/Runtime/DiagnosticSystem/DebugReport.cs b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugReport.cs index 2b13fe7..a049f48 100644 --- a/Assets/YooAsset/Runtime/DiagnosticSystem/DebugReport.cs +++ b/Assets/YooAsset/Runtime/DiagnosticSystem/DebugReport.cs @@ -12,17 +12,21 @@ namespace YooAsset [Serializable] internal class DebugReport { - public List ProviderInfos = new List(1000); - /// /// 游戏帧 /// public int FrameCount; + /// + /// 调试的包裹数据列表 + /// + public List PackageDatas = new List(10); + + /// /// 序列化 /// - public static byte[] Serialize(DebugReport debugReport) + public static byte[] Serialize(DebugReport debugReport) { return Encoding.UTF8.GetBytes(JsonUtility.ToJson(debugReport)); } diff --git a/Assets/YooAsset/Runtime/YooAssets.cs b/Assets/YooAsset/Runtime/YooAssets.cs index 61eac90..56f5d65 100644 --- a/Assets/YooAsset/Runtime/YooAssets.cs +++ b/Assets/YooAsset/Runtime/YooAssets.cs @@ -135,7 +135,7 @@ namespace YooAsset } return false; } - + /// /// 开启一个异步操作 /// @@ -236,12 +236,9 @@ namespace YooAsset foreach (var package in _packages) { - var result = package.GetDebugReportInfos(); - report.ProviderInfos.AddRange(result); + var packageData = package.GetDebugPackageData(); + report.PackageDatas.Add(packageData); } - - // 重新排序 - report.ProviderInfos.Sort(); return report; } #endregion