Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EntityCommandBufferBase

A buffer for entity commands. You can use it to apply the commands to a ut.World. at a later time. You can also use it to apply the commands multiple times in order to perform a complex operation or build up a complex set of reusable entities. You should only need to create an EntityCommandBuffer manually in special use cases such as recording a command buffer in order to play it back multiple times.

You can use an EntityCommandBuffer much as you would a ut.World, but the entities that {@link ut.EntityCommandBuffer.CreateDeferredEntity} and related methods return are "deferred" entities that are only valid to be passed to EntityCommandBuffer. After playback, you can obtain the real entities by passing a deferred entity to {@link ut.EntityCommandBuffer.TranslateDeferredEntity}.

Hierarchy

Index

Methods

addComponentRaw

  • Adds a component to {@link entity}. Raw form.

    Parameters

    Returns void

commit

  • Applies the commands in this buffer, and then immediately disposes of it.

    Parameters

    Returns void

createDeferredEntity

  • Creates one entity of {@link archetype}, and returns its deferred entity handle.

    Parameters

    Returns Entity

createEntities

  • createEntities(archetype: Archetype, count: number): void
  • Creates count entities of {@link archetype}.

    Parameters

    Returns void

createEntity

  • Creates one entity of {@link archetype}.

    Parameters

    Returns void

destroyEntity

  • destroyEntity(entity: Entity): void
  • Destroys entity.

    Parameters

    Returns void

dispose

  • dispose(): void
  • Disposes of an EntityCommandBuffer, frees buffers, and cleans up any component data.

    Returns void

instantiateDeferredEntity

  • Instantiates (clones) one entity of source {@link entity}, and returns its deferred entity handle. The source entity may be real or deferred.

    Parameters

    Returns Entity

instantiateEntities

  • instantiateEntities(entity: Entity, count: number): void
  • Instantiates (clones) count entities of source {@link entity}. The source entity may be real or deferred.

    Parameters

    • entity: Entity
    • count: number

    Returns void

playback

  • Parameters

    Returns void

removeComponentRaw

  • Removes a component from {@link entity}. Raw form.

    Parameters

    Returns void

setEntityName

  • setEntityName(entity: Entity, name: string): void
  • Adds a command to set the name of {@link entity} to this buffer.

    Parameters

    Returns void

translateDeferredEntity

  • Returns the real entity that corresponds to the entity for {@link deferred} after the most recent playback.

    Parameters

    Returns Entity

Generated using TypeDoc