Struct EntityCommandBuffer | Entities | 0.2.0-preview.18
docs.unity3d.com
    Show / Hide Table of Contents

    Struct EntityCommandBuffer

    A thread-safe command buffer that can buffer commands that affect entities and components for later playback.

    Namespace: Unity.Entities
    Syntax
    public struct EntityCommandBuffer : IDisposable

    Constructors

    EntityCommandBuffer(Allocator)

    Creates a new command buffer.

    Declaration
    public EntityCommandBuffer(Allocator label)
    Parameters
    Type Name Description
    Allocator label

    Memory allocator to use for chunks and data

    Properties

    IsCreated

    Declaration
    public bool IsCreated { get; }
    Property Value
    Type Description
    Boolean

    MinimumChunkSize

    Allows controlling the size of chunks allocated from the temp job allocator to back the command buffer.

    Declaration
    public int MinimumChunkSize { get; set; }
    Property Value
    Type Description
    Int32

    ShouldPlayback

    Controls whether this command buffer should play back.

    Declaration
    public bool ShouldPlayback { get; set; }
    Property Value
    Type Description
    Boolean

    Methods

    AddBuffer<T>(Entity)

    Declaration
    public DynamicBuffer<T> AddBuffer<T>(Entity e)
        where T : struct, IBufferElementData
    Parameters
    Type Name Description
    Entity e
    Returns
    Type Description
    DynamicBuffer<T>
    Type Parameters
    Name Description
    T

    AddComponent(Entity, ComponentType)

    Declaration
    public void AddComponent(Entity e, ComponentType componentType)
    Parameters
    Type Name Description
    Entity e
    ComponentType componentType

    AddComponent(EntityQuery, ComponentType)

    Declaration
    public void AddComponent(EntityQuery entityQuery, ComponentType componentType)
    Parameters
    Type Name Description
    EntityQuery entityQuery
    ComponentType componentType

    AddComponent<T>(Entity)

    Declaration
    public void AddComponent<T>(Entity e)
        where T : struct, IComponentData
    Parameters
    Type Name Description
    Entity e
    Type Parameters
    Name Description
    T

    AddComponent<T>(Entity, T)

    Declaration
    public void AddComponent<T>(Entity e, T component)
        where T : struct, IComponentData
    Parameters
    Type Name Description
    Entity e
    T component
    Type Parameters
    Name Description
    T

    AddSharedComponent<T>(Entity, T)

    Declaration
    public void AddSharedComponent<T>(Entity e, T component)
        where T : struct, ISharedComponentData
    Parameters
    Type Name Description
    Entity e
    T component
    Type Parameters
    Name Description
    T

    AddSharedComponent<T>(EntityQuery, T)

    Declaration
    public void AddSharedComponent<T>(EntityQuery entityQuery, T component)
        where T : struct, ISharedComponentData
    Parameters
    Type Name Description
    EntityQuery entityQuery
    T component
    Type Parameters
    Name Description
    T

    CreateEntity(EntityArchetype)

    Declaration
    public Entity CreateEntity(EntityArchetype archetype = default(EntityArchetype))
    Parameters
    Type Name Description
    EntityArchetype archetype
    Returns
    Type Description
    Entity

    DestroyEntity(Entity)

    Declaration
    public void DestroyEntity(Entity e)
    Parameters
    Type Name Description
    Entity e

    DestroyEntity(EntityQuery)

    Declaration
    public void DestroyEntity(EntityQuery entityQuery)
    Parameters
    Type Name Description
    EntityQuery entityQuery

    Dispose()

    Declaration
    public void Dispose()

    Instantiate(Entity)

    Declaration
    public Entity Instantiate(Entity e)
    Parameters
    Type Name Description
    Entity e
    Returns
    Type Description
    Entity

    Playback(EntityManager)

    Play back all recorded operations against an entity manager.

    Declaration
    public void Playback(EntityManager mgr)
    Parameters
    Type Name Description
    EntityManager mgr

    The entity manager that will receive the operations

    Playback(ExclusiveEntityTransaction)

    Play back all recorded operations with an exclusive entity transaction. BeginExclusiveEntityTransaction().

    Declaration
    public void Playback(ExclusiveEntityTransaction mgr)
    Parameters
    Type Name Description
    ExclusiveEntityTransaction mgr

    The exclusive entity transaction that will process the operations

    RemoveComponent(Entity, ComponentType)

    Declaration
    public void RemoveComponent(Entity e, ComponentType componentType)
    Parameters
    Type Name Description
    Entity e
    ComponentType componentType

    RemoveComponent(EntityQuery, ComponentType)

    Declaration
    public void RemoveComponent(EntityQuery entityQuery, ComponentType componentType)
    Parameters
    Type Name Description
    EntityQuery entityQuery
    ComponentType componentType

    RemoveComponent<T>(Entity)

    Declaration
    public void RemoveComponent<T>(Entity e)
    Parameters
    Type Name Description
    Entity e
    Type Parameters
    Name Description
    T

    SetBuffer<T>(Entity)

    Declaration
    public DynamicBuffer<T> SetBuffer<T>(Entity e)
        where T : struct, IBufferElementData
    Parameters
    Type Name Description
    Entity e
    Returns
    Type Description
    DynamicBuffer<T>
    Type Parameters
    Name Description
    T

    SetComponent<T>(Entity, T)

    Declaration
    public void SetComponent<T>(Entity e, T component)
        where T : struct, IComponentData
    Parameters
    Type Name Description
    Entity e
    T component
    Type Parameters
    Name Description
    T

    SetSharedComponent<T>(Entity, T)

    Declaration
    public void SetSharedComponent<T>(Entity e, T component)
        where T : struct, ISharedComponentData
    Parameters
    Type Name Description
    Entity e
    T component
    Type Parameters
    Name Description
    T

    ToConcurrent()

    Declaration
    public EntityCommandBuffer.Concurrent ToConcurrent()
    Returns
    Type Description
    EntityCommandBuffer.Concurrent

    Extension Methods

    EntityCommandBufferManagedComponentExtensions.AddComponent<T>(EntityCommandBuffer, Entity, T)
    EntityCommandBufferManagedComponentExtensions.AddComponent<T>(EntityCommandBuffer, Entity)
    EntityCommandBufferManagedComponentExtensions.SetComponent<T>(EntityCommandBuffer, Entity, T)
    Back to top Copyright © 2019 Unity Technologies
    Generated by DocFX