Method RegisterSingleton
RegisterSingleton<T>(EntityCommandBufferSystem, ref UnsafeList<EntityCommandBuffer>, WorldUnmanaged)
Every unmanaged Singleton that implements IECBSingleton must be registered by this function, at the end of its owner's EntityCommandBufferSystem.OnCreate method, in order to prepare the Singleton with the unmanaged data necessary for it to work from unmanaged code, without holding a managed reference to the EntityCommandBufferSystem. This Singleton component will be added to the system entity for this EntityCommandBufferSystem derived type.
Declaration
public static void RegisterSingleton<T>(this EntityCommandBufferSystem system, ref UnsafeList<EntityCommandBuffer> pendingBuffers, WorldUnmanaged world) where T : unmanaged, IECBSingleton, IComponentData
Parameters
Type | Name | Description |
---|---|---|
EntityCommandBufferSystem | system | The managed EntityCommandBufferSystem that owns the Singleton |
UnsafeList<EntityCommandBuffer> | pendingBuffers | The list of command buffers in the managed System to append to |
WorldUnmanaged | world | The world that this command buffer buffers changes for |
Type Parameters
Name | Description |
---|---|
T | The unmanaged Singleton type, that corresponds to the managed EntityCommandBufferSystem subclass |
RegisterSingleton<T>(EntityCommandBufferSystem, ref UnsafeList<EntityCommandBuffer>, WorldUnmanaged, string)
Obsolete. System entities are used for ECB component data, rather than entityName.
Declaration
[Obsolete("The entityName parameter is obsolete. System entities are now used for ECB component data.")]
public static void RegisterSingleton<T>(this EntityCommandBufferSystem system, ref UnsafeList<EntityCommandBuffer> pendingBuffers, WorldUnmanaged world, string entityName) where T : unmanaged, IECBSingleton, IComponentData
Parameters
Type | Name | Description |
---|---|---|
EntityCommandBufferSystem | system | The managed EntityCommandBufferSystem that owns the Singleton |
UnsafeList<EntityCommandBuffer> | pendingBuffers | The list of command buffers in the managed System to append to |
WorldUnmanaged | world | The world that this command buffer buffers changes for |
string | entityName | The name of the entity. |
Type Parameters
Name | Description |
---|---|
T | The unmanaged Singleton type, that corresponds to the managed EntityCommandBufferSystem subclass |