您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

35 行
1.5 KiB

namespace Unity.Netcode
{
internal interface IDeferredMessageManager
{
internal enum TriggerType
{
OnSpawn,
OnAddPrefab,
}
/// <summary>
/// Defers processing of a message until the moment a specific networkObjectId is spawned.
/// This is to handle situations where an RPC or other object-specific message arrives before the spawn does,
/// either due to it being requested in OnNetworkSpawn before the spawn call has been executed
///
/// There is a one second maximum lifetime of triggers to avoid memory leaks. After one second has passed
/// without the requested object ID being spawned, the triggers for it are automatically deleted.
/// </summary>
void DeferMessage(TriggerType trigger, ulong key, FastBufferReader reader, ref NetworkContext context);
/// <summary>
/// Cleans up any trigger that's existed for more than a second.
/// These triggers were probably for situations where a request was received after a despawn rather than before a spawn.
/// </summary>
void CleanupStaleTriggers();
void ProcessTriggers(TriggerType trigger, ulong key);
/// <summary>
/// Cleans up any trigger that's existed for more than a second.
/// These triggers were probably for situations where a request was received after a despawn rather than before a spawn.
/// </summary>
void CleanupAllTriggers();
}
}