docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct NetworkGroupCommandBufferSystem.Singleton

    Call Unity.Entities.SystemAPI.GetSingleton<T>() to get this component for this system, and then call CreateCommandBuffer(WorldUnmanaged) on this singleton to create an ECB to be played back by this system.

    Implements
    IComponentData
    IQueryTypeParameter
    IECBSingleton
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    public struct NetworkGroupCommandBufferSystem.Singleton : IComponentData, IQueryTypeParameter, IECBSingleton
    Remarks

    Useful if you want to record entity commands now, but play them back at a later point in the frame, or early in the next frame.

    Methods

    CreateCommandBuffer(WorldUnmanaged)

    Create a command buffer for the parent system to play back.

    Declaration
    public EntityCommandBuffer CreateCommandBuffer(WorldUnmanaged world)
    Parameters
    Type Name Description
    WorldUnmanaged world

    The world in which to play it back.

    Returns
    Type Description
    EntityCommandBuffer

    The command buffer to record to.

    Remarks

    The command buffers created by this method are automatically added to the system's list of pending buffers.

    SetAllocator(Allocator)

    Set the allocator that command buffers created with this singleton should be allocated with.

    Declaration
    public void SetAllocator(Allocator allocatorIn)
    Parameters
    Type Name Description
    Allocator allocatorIn

    The allocator to use

    SetAllocator(AllocatorHandle)

    Set the allocator that command buffers created with this singleton should be allocated with.

    Declaration
    public void SetAllocator(AllocatorManager.AllocatorHandle allocatorIn)
    Parameters
    Type Name Description
    AllocatorManager.AllocatorHandle allocatorIn

    The allocator to use

    SetPendingBufferList(ref UnsafeList<EntityCommandBuffer>)

    Sets the list of command buffers to play back when this system updates.

    Declaration
    public void SetPendingBufferList(ref UnsafeList<EntityCommandBuffer> buffers)
    Parameters
    Type Name Description
    UnsafeList<EntityCommandBuffer> buffers

    The list of buffers to play back. This list replaces any existing pending command buffers on this system.

    Remarks

    This method is only intended for internal use, but must be in the public API due to language restrictions. Command buffers created with CreateCommandBuffer(WorldUnmanaged) are automatically added to the system's list of pending buffers to play back.

    Implements

    Unity.Entities.IComponentData
    Unity.Entities.IQueryTypeParameter
    Unity.Entities.IECBSingleton
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)