Update runtime code
parent
989d88f7d3
commit
c196e44bc6
|
@ -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;
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
[Serializable]
|
||||
internal class DebugBundleInfo
|
||||
internal class DebugBundleInfo : IComparer<DebugBundleInfo>, IComparable<DebugBundleInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// 包裹名
|
||||
/// </summary>
|
||||
public string PackageName { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源包名称
|
||||
/// </summary>
|
||||
|
@ -19,5 +26,14 @@ namespace YooAsset
|
|||
/// 加载状态
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
{
|
||||
/// <summary>
|
||||
/// 所属的资源包裹
|
||||
/// 包裹名
|
||||
/// </summary>
|
||||
public string PackageName;
|
||||
public string PackageName { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源对象路径
|
||||
|
|
|
@ -12,17 +12,21 @@ namespace YooAsset
|
|||
[Serializable]
|
||||
internal class DebugReport
|
||||
{
|
||||
public List<DebugProviderInfo> ProviderInfos = new List<DebugProviderInfo>(1000);
|
||||
|
||||
/// <summary>
|
||||
/// 游戏帧
|
||||
/// </summary>
|
||||
public int FrameCount;
|
||||
|
||||
/// <summary>
|
||||
/// 调试的包裹数据列表
|
||||
/// </summary>
|
||||
public List<DebugPackageData> PackageDatas = new List<DebugPackageData>(10);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 序列化
|
||||
/// </summary>
|
||||
public static byte[] Serialize(DebugReport debugReport)
|
||||
public static byte[] Serialize(DebugReport debugReport)
|
||||
{
|
||||
return Encoding.UTF8.GetBytes(JsonUtility.ToJson(debugReport));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue