From 6c0fbdae1ff394e5afd323dcc90d4eaf839c4163 Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 15 Mar 2022 22:29:20 +0800 Subject: [PATCH] Update YooAsset --- .../Runtime/AssetSystem/AssetSystem.cs | 2 +- .../AssetSystem/Loader/DependBundleGrouper.cs | 14 ++-- .../AssetSystem/Provider/BundledProvider.cs | 14 ++-- .../Runtime/{Profiler.meta => Debugger.meta} | 0 .../Runtime/Debugger/DebugBundleInfo.cs | 26 ++++++ .../Runtime/Debugger/DebugBundleInfo.cs.meta | 11 +++ .../Runtime/Debugger/DebugProviderInfo.cs | 38 +++++++++ .../Debugger/DebugProviderInfo.cs.meta | 11 +++ .../YooAsset/Runtime/Debugger/DebugSummy.cs | 21 +++++ .../{Profiler => Debugger}/DebugSummy.cs.meta | 0 .../YooAsset/Runtime/Profiler/DebugSummy.cs | 80 ------------------- Assets/YooAsset/Runtime/YooAssets.cs | 2 +- 12 files changed, 123 insertions(+), 96 deletions(-) rename Assets/YooAsset/Runtime/{Profiler.meta => Debugger.meta} (100%) create mode 100644 Assets/YooAsset/Runtime/Debugger/DebugBundleInfo.cs create mode 100644 Assets/YooAsset/Runtime/Debugger/DebugBundleInfo.cs.meta create mode 100644 Assets/YooAsset/Runtime/Debugger/DebugProviderInfo.cs create mode 100644 Assets/YooAsset/Runtime/Debugger/DebugProviderInfo.cs.meta create mode 100644 Assets/YooAsset/Runtime/Debugger/DebugSummy.cs rename Assets/YooAsset/Runtime/{Profiler => Debugger}/DebugSummy.cs.meta (100%) delete mode 100644 Assets/YooAsset/Runtime/Profiler/DebugSummy.cs diff --git a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs index a1feec7..98895b9 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs @@ -304,7 +304,7 @@ namespace YooAsset foreach (var provider in _providers) { - DebugSummy.DebugProviderInfo providerInfo = new DebugSummy.DebugProviderInfo(); + DebugProviderInfo providerInfo = new DebugProviderInfo(); providerInfo.AssetPath = provider.AssetPath; providerInfo.RefCount = provider.RefCount; providerInfo.Status = (int)provider.Status; diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs index 2e090c6..0557a0a 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs @@ -66,16 +66,16 @@ namespace YooAsset /// /// 获取资源包的调试信息列表 /// - internal void GetBundleDebugInfos(List output) + internal void GetBundleDebugInfos(List output) { foreach (var loader in _dependBundles) { - var debugInfo = new DebugSummy.DebugBundleInfo(); - debugInfo.BundleName = loader.BundleFileInfo.BundleName; - debugInfo.Version = loader.BundleFileInfo.Version; - debugInfo.RefCount = loader.RefCount; - debugInfo.Status = (int)loader.Status; - output.Add(debugInfo); + var bundleInfo = new DebugBundleInfo(); + bundleInfo.BundleName = loader.BundleFileInfo.BundleName; + bundleInfo.Version = loader.BundleFileInfo.Version; + bundleInfo.RefCount = loader.RefCount; + bundleInfo.Status = (int)loader.Status; + output.Add(bundleInfo); } } } diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs index 610b950..61acf6b 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs @@ -36,14 +36,14 @@ namespace YooAsset /// /// 获取资源包的调试信息列表 /// - internal void GetBundleDebugInfos(List output) + internal void GetBundleDebugInfos(List output) { - var ownerInfo = new DebugSummy.DebugBundleInfo(); - ownerInfo.BundleName = OwnerBundle.BundleFileInfo.BundleName; - ownerInfo.Version = OwnerBundle.BundleFileInfo.Version; - ownerInfo.RefCount = OwnerBundle.RefCount; - ownerInfo.Status = (int)OwnerBundle.Status; - output.Add(ownerInfo); + var bundleInfo = new DebugBundleInfo(); + bundleInfo.BundleName = OwnerBundle.BundleFileInfo.BundleName; + bundleInfo.Version = OwnerBundle.BundleFileInfo.Version; + bundleInfo.RefCount = OwnerBundle.RefCount; + bundleInfo.Status = (int)OwnerBundle.Status; + output.Add(bundleInfo); DependBundles.GetBundleDebugInfos(output); } diff --git a/Assets/YooAsset/Runtime/Profiler.meta b/Assets/YooAsset/Runtime/Debugger.meta similarity index 100% rename from Assets/YooAsset/Runtime/Profiler.meta rename to Assets/YooAsset/Runtime/Debugger.meta diff --git a/Assets/YooAsset/Runtime/Debugger/DebugBundleInfo.cs b/Assets/YooAsset/Runtime/Debugger/DebugBundleInfo.cs new file mode 100644 index 0000000..e6d0ebf --- /dev/null +++ b/Assets/YooAsset/Runtime/Debugger/DebugBundleInfo.cs @@ -0,0 +1,26 @@ + +namespace YooAsset +{ + internal class DebugBundleInfo + { + /// + /// 资源包名称 + /// + public string BundleName { set; get; } + + /// + /// 资源版本 + /// + public int Version { set; get; } + + /// + /// 引用计数 + /// + public int RefCount { set; get; } + + /// + /// 加载状态 + /// + public int Status { set; get; } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/Debugger/DebugBundleInfo.cs.meta b/Assets/YooAsset/Runtime/Debugger/DebugBundleInfo.cs.meta new file mode 100644 index 0000000..cf32d98 --- /dev/null +++ b/Assets/YooAsset/Runtime/Debugger/DebugBundleInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8338e9d79d24e7e4e80aaacc8bc0fcde +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Runtime/Debugger/DebugProviderInfo.cs b/Assets/YooAsset/Runtime/Debugger/DebugProviderInfo.cs new file mode 100644 index 0000000..0acfd42 --- /dev/null +++ b/Assets/YooAsset/Runtime/Debugger/DebugProviderInfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace YooAsset +{ + internal class DebugProviderInfo : IComparer, IComparable + { + /// + /// 资源对象路径 + /// + public string AssetPath { set; get; } + + /// + /// 引用计数 + /// + public int RefCount { set; get; } + + /// + /// 加载状态 + /// + public int Status { set; get; } + + /// + /// 依赖的资源包列表 + /// + public readonly List BundleInfos = new List(); + + public int CompareTo(DebugProviderInfo other) + { + return Compare(this, other); + } + public int Compare(DebugProviderInfo a, DebugProviderInfo b) + { + return string.CompareOrdinal(a.AssetPath, b.AssetPath); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/Debugger/DebugProviderInfo.cs.meta b/Assets/YooAsset/Runtime/Debugger/DebugProviderInfo.cs.meta new file mode 100644 index 0000000..a698fc1 --- /dev/null +++ b/Assets/YooAsset/Runtime/Debugger/DebugProviderInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3af795872a84c6429235be37acaf655 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Runtime/Debugger/DebugSummy.cs b/Assets/YooAsset/Runtime/Debugger/DebugSummy.cs new file mode 100644 index 0000000..4cd14dc --- /dev/null +++ b/Assets/YooAsset/Runtime/Debugger/DebugSummy.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace YooAsset +{ + /// + /// 资源系统调试信息汇总 + /// + internal class DebugSummy + { + public readonly List ProviderInfos = new List(1000); + public int BundleCount { set; get; } + public int AssetCount { set; get; } + + public void ClearAll() + { + ProviderInfos.Clear(); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/Profiler/DebugSummy.cs.meta b/Assets/YooAsset/Runtime/Debugger/DebugSummy.cs.meta similarity index 100% rename from Assets/YooAsset/Runtime/Profiler/DebugSummy.cs.meta rename to Assets/YooAsset/Runtime/Debugger/DebugSummy.cs.meta diff --git a/Assets/YooAsset/Runtime/Profiler/DebugSummy.cs b/Assets/YooAsset/Runtime/Profiler/DebugSummy.cs deleted file mode 100644 index e457f72..0000000 --- a/Assets/YooAsset/Runtime/Profiler/DebugSummy.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -namespace YooAsset -{ - public class DebugSummy - { - /// - /// 资源包调试信息 - /// - public class DebugBundleInfo - { - /// - /// 资源包名称 - /// - public string BundleName { set; get; } - - /// - /// 资源版本 - /// - public int Version { set; get; } - - /// - /// 引用计数 - /// - public int RefCount { set; get; } - - /// - /// 加载状态 - /// - public int Status { set; get; } - } - - /// - /// 资源加载对象调试信息 - /// - public class DebugProviderInfo : IComparer, IComparable - { - /// - /// 资源对象路径 - /// - public string AssetPath { set; get; } - - /// - /// 引用计数 - /// - public int RefCount { set; get; } - - /// - /// 加载状态 - /// - public int Status { set; get; } - - /// - /// 依赖的资源包列表 - /// - public readonly List BundleInfos = new List(); - - public int CompareTo(DebugProviderInfo other) - { - return Compare(this, other); - } - public int Compare(DebugProviderInfo a, DebugProviderInfo b) - { - return string.CompareOrdinal(a.AssetPath, b.AssetPath); - } - } - - - public readonly List ProviderInfos = new List(1000); - public int BundleCount { set; get; } - public int AssetCount { set; get; } - - public void ClearAll() - { - ProviderInfos.Clear(); - } - } -} \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/YooAssets.cs b/Assets/YooAsset/Runtime/YooAssets.cs index a49dcd0..ddbcb94 100644 --- a/Assets/YooAsset/Runtime/YooAssets.cs +++ b/Assets/YooAsset/Runtime/YooAssets.cs @@ -280,7 +280,7 @@ namespace YooAsset /// /// 获取调试汇总信息 /// - public static void GetDebugSummy(DebugSummy summy) + internal static void GetDebugSummy(DebugSummy summy) { if (summy == null) YooLogger.Error($"{nameof(DebugSummy)} is null");