docs.unity3d.com
    Show / Hide Table of Contents

    Method CreateEntity

    CreateEntity(EntityArchetype)

    Records a command to create an entity with specified archetype.

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

    The archetype of the new entity.

    Returns
    Type Description
    Entity

    An entity that is deferred and will be fully realized when this EntityCommandBuffer is played back.

    Exceptions
    Type Condition
    ArgumentException

    Throws if the archetype is null.

    NullReferenceException

    Throws if an Allocator was not passed in when the EntityCommandBuffer was created.

    InvalidOperationException

    Throws if this EntityCommandBuffer has already been played back.

    CreateEntity()

    Records a command to create an entity with no components.

    Declaration
    public Entity CreateEntity()
    Returns
    Type Description
    Entity

    An entity that is deferred and will be fully realized when this EntityCommandBuffer is played back.

    Exceptions
    Type Condition
    NullReferenceException

    Throws if an Allocator was not passed in when the EntityCommandBuffer was created.

    InvalidOperationException

    Throws if this EntityCommandBuffer has already been played back.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023