mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-29 20:48:47 +00:00
Update runtime code
This commit is contained in:
@@ -341,7 +341,6 @@ namespace YooAsset
|
|||||||
foreach (var provider in _providers)
|
foreach (var provider in _providers)
|
||||||
{
|
{
|
||||||
DebugProviderInfo providerInfo = new DebugProviderInfo();
|
DebugProviderInfo providerInfo = new DebugProviderInfo();
|
||||||
providerInfo.PackageName = BundleServices.GetPackageName();
|
|
||||||
providerInfo.AssetPath = provider.MainAssetInfo.AssetPath;
|
providerInfo.AssetPath = provider.MainAssetInfo.AssetPath;
|
||||||
providerInfo.SpawnScene = provider.SpawnScene;
|
providerInfo.SpawnScene = provider.SpawnScene;
|
||||||
providerInfo.SpawnTime = provider.SpawnTime;
|
providerInfo.SpawnTime = provider.SpawnTime;
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal class DebugBundleInfo
|
internal class DebugBundleInfo : IComparer<DebugBundleInfo>, IComparable<DebugBundleInfo>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 包裹名
|
||||||
|
/// </summary>
|
||||||
|
public string PackageName { set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源包名称
|
/// 资源包名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -19,5 +26,14 @@ namespace YooAsset
|
|||||||
/// 加载状态
|
/// 加载状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Status;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
21
Assets/YooAsset/Runtime/DiagnosticSystem/DebugPackageData.cs
Normal file
21
Assets/YooAsset/Runtime/DiagnosticSystem/DebugPackageData.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace YooAsset
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
internal class DebugPackageData
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 包裹名称
|
||||||
|
/// </summary>
|
||||||
|
public string PackageName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 调试数据列表
|
||||||
|
/// </summary>
|
||||||
|
public List<DebugProviderInfo> ProviderInfos = new List<DebugProviderInfo>(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 583d0c3e5520c6748b2aeacd209cf8b6
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -8,9 +8,9 @@ namespace YooAsset
|
|||||||
internal class DebugProviderInfo : IComparer<DebugProviderInfo>, IComparable<DebugProviderInfo>
|
internal class DebugProviderInfo : IComparer<DebugProviderInfo>, IComparable<DebugProviderInfo>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属的资源包裹
|
/// 包裹名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PackageName;
|
public string PackageName { set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源对象路径
|
/// 资源对象路径
|
||||||
|
|||||||
@@ -12,13 +12,17 @@ namespace YooAsset
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
internal class DebugReport
|
internal class DebugReport
|
||||||
{
|
{
|
||||||
public List<DebugProviderInfo> ProviderInfos = new List<DebugProviderInfo>(1000);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 游戏帧
|
/// 游戏帧
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int FrameCount;
|
public int FrameCount;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 调试的包裹数据列表
|
||||||
|
/// </summary>
|
||||||
|
public List<DebugPackageData> PackageDatas = new List<DebugPackageData>(10);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序列化
|
/// 序列化
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -236,12 +236,9 @@ namespace YooAsset
|
|||||||
|
|
||||||
foreach (var package in _packages)
|
foreach (var package in _packages)
|
||||||
{
|
{
|
||||||
var result = package.GetDebugReportInfos();
|
var packageData = package.GetDebugPackageData();
|
||||||
report.ProviderInfos.AddRange(result);
|
report.PackageDatas.Add(packageData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重新排序
|
|
||||||
report.ProviderInfos.Sort();
|
|
||||||
return report;
|
return report;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user