update diagnostic system

This commit is contained in:
何冠峰
2025-02-28 18:38:18 +08:00
parent e7d346e4e1
commit 3069b1d1f1
44 changed files with 765 additions and 172 deletions

View File

@@ -8,11 +8,15 @@ namespace YooAsset
{
public abstract class AsyncOperationBase : IEnumerator, IComparable<AsyncOperationBase>
{
private readonly List<AsyncOperationBase> _childs = new List<AsyncOperationBase>(10);
private Action<AsyncOperationBase> _callback;
private string _packageName = null;
private int _whileFrame = 1000;
/// <summary>
/// 所有子任务
/// </summary>
internal readonly List<AsyncOperationBase> Childs = new List<AsyncOperationBase>(10);
/// <summary>
/// 等待异步执行完成
/// </summary>
@@ -109,6 +113,10 @@ namespace YooAsset
{
throw new System.NotImplementedException(this.GetType().Name);
}
internal virtual string InternalGetDesc()
{
return string.Empty;
}
/// <summary>
/// 设置包裹名称
@@ -124,11 +132,19 @@ namespace YooAsset
internal void AddChildOperation(AsyncOperationBase child)
{
#if UNITY_EDITOR
if (_childs.Contains(child))
if (Childs.Contains(child))
throw new Exception($"The child node {child.GetType().Name} already exists !");
#endif
_childs.Add(child);
Childs.Add(child);
}
/// <summary>
/// 获取异步操作说明
/// </summary>
internal string GetOperationDesc()
{
return InternalGetDesc();
}
/// <summary>
@@ -185,7 +201,7 @@ namespace YooAsset
/// </summary>
internal void AbortOperation()
{
foreach (var child in _childs)
foreach (var child in Childs)
{
child.AbortOperation();
}