com.alicizax.unity.tuyoogam.../Runtime/DiagnosticSystem/DebugPackageData.cs

54 lines
1.6 KiB
C#
Raw Permalink Normal View History

2025-01-09 11:31:04 +08:00
using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
namespace YooAsset
{
[Serializable]
internal class DebugPackageData
{
/// <summary>
/// 包裹名称
/// </summary>
public string PackageName;
public List<DebugProviderInfo> ProviderInfos = new List<DebugProviderInfo>(1000);
2025-02-28 16:11:01 +08:00
public List<DebugBundleInfo> BundleInfos = new List<DebugBundleInfo>(1000);
2025-04-01 21:12:28 +08:00
public List<DebugOperationInfo> OperationInfos = new List<DebugOperationInfo>(1000);
2025-02-28 16:11:01 +08:00
[NonSerialized]
public Dictionary<string, DebugBundleInfo> BundleInfoDic = new Dictionary<string, DebugBundleInfo>();
private bool _isParse = false;
/// <summary>
/// 获取调试资源包信息类
/// </summary>
public DebugBundleInfo GetBundleInfo(string bundleName)
{
// 解析数据
if (_isParse == false)
{
_isParse = true;
foreach (var bundleInfo in BundleInfos)
{
if (BundleInfoDic.ContainsKey(bundleInfo.BundleName) == false)
{
BundleInfoDic.Add(bundleInfo.BundleName, bundleInfo);
}
}
}
if (BundleInfoDic.TryGetValue(bundleName, out DebugBundleInfo value))
{
return value;
}
else
{
UnityEngine.Debug.LogError($"Can not found {nameof(DebugBundleInfo)} : {bundleName}");
2025-04-01 21:12:28 +08:00
return default;
2025-02-28 16:11:01 +08:00
}
}
2025-01-09 11:31:04 +08:00
}
}