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);
public List BundleInfos = new List(1000);
public List OperationInfos = new List(1000);
[NonSerialized]
public Dictionary BundleInfoDic = new Dictionary();
private bool _isParse = false;
///
/// 获取调试资源包信息类
///
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}");
return default;
}
}
}
}