您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
52 行
1.4 KiB
52 行
1.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Unity.Jobs
|
|
{
|
|
/// <summary>
|
|
/// Used by automatically generated code. Do not use in projects.
|
|
/// </summary>
|
|
public class EarlyInitHelpers
|
|
{
|
|
public delegate void EarlyInitFunction();
|
|
|
|
private static List<EarlyInitFunction> s_PendingDelegates;
|
|
|
|
public static void FlushEarlyInits()
|
|
{
|
|
while (s_PendingDelegates != null)
|
|
{
|
|
var oldList = s_PendingDelegates;
|
|
s_PendingDelegates = null;
|
|
|
|
for (int i = 0; i < oldList.Count; ++i)
|
|
{
|
|
try
|
|
{
|
|
oldList[i]();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Debug.LogException(ex);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void AddEarlyInitFunction(EarlyInitFunction f)
|
|
{
|
|
if (s_PendingDelegates == null)
|
|
s_PendingDelegates = new List<EarlyInitFunction>();
|
|
|
|
s_PendingDelegates.Add(f);
|
|
}
|
|
|
|
public static void JobReflectionDataCreationFailed(Exception ex, Type jobType)
|
|
{
|
|
Debug.LogError($"Failed to create job reflection data for type ${jobType}:");
|
|
Debug.LogException(ex);
|
|
}
|
|
}
|
|
|
|
}
|