docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ExclusiveEntityTransaction

    Provides an interface to safely perform EntityManager operations from a single worker thread, by temporarily giving that thread exclusive access to a World's EntityManager.

    Namespace: Unity.Entities
    Assembly: Unity.Entities.dll
    Syntax
    public struct ExclusiveEntityTransaction
    Remarks

    The intended use case for this feature is to let a worker thread stream Entity data into a staging World and perform any necessary post-processing structural changes, prior to moving the final data into the main simulation world using MoveEntitiesFrom(EntityManager). This lets the main thread continue to safely process the primary world while the new data is loading in, and not require a main-thread sync point until the new Entities are fully loaded and ready to be injected.

    Properties

    Name Description
    EntityManager

    Return the entity manager this transaction operates upon

    Methods

    Name Description
    AddBuffer<T>(Entity)

    Adds a dynamic buffer component to an entity.

    AddComponent(Entity, ComponentType)

    Adds a component to an entity.

    AddSharedComponentData<T>(Entity, T)

    Obsolete. Use AddSharedComponentManaged<T>(Entity, T) instead.

    AddSharedComponentManaged<T>(NativeArray<Entity>, T)

    Adds a shared component to an array of entities

    AddSharedComponentManaged<T>(Entity, T)

    Adds a shared component to an entity.

    AddSharedComponent<T>(NativeArray<Entity>, T)

    Adds a shared component to multiple entities

    AddSharedComponent<T>(Entity, T)

    Adds a shared component to an entity.

    CreateArchetype(params ComponentType[])

    Creates an archetype from a set of component types.

    CreateEntity(params ComponentType[])

    Creates an entity having components of the specified types.

    CreateEntity(EntityArchetype)

    Creates an entity having the specified archetype.

    CreateEntity(EntityArchetype, NativeArray<Entity>)

    Creates a set of entities of the specified archetype.

    DestroyEntity(NativeArray<Entity>)

    Destroys all entities in an array.

    DestroyEntity(NativeSlice<Entity>)

    Destroys all entities in a slice of an array.

    DestroyEntity(Entity)

    Destroys an entity.

    Exists(Entity)

    Reports whether an Entity object is still valid.

    GetBuffer<T>(Entity, bool)

    Gets the dynamic buffer of an entity.

    GetComponentData<T>(Entity)

    Gets the value of a component for an entity.

    GetSharedComponentData<T>(Entity)

    Obsolete. Use GetSharedComponentManaged<T>(Entity) instead.

    GetSharedComponentManaged<T>(Entity)

    Gets a shared component from an entity.

    GetSharedComponent<T>(Entity)

    Gets a shared component from an entity.

    HasBuffer<T>(Entity)

    Checks whether an entity has a dynamic buffer of a specific IBufferElementData type.

    HasComponent(Entity, ComponentType)

    Checks whether an entity has a specific type of component.

    Instantiate(Entity)

    Clones an entity.

    Instantiate(Entity, NativeArray<Entity>)

    Makes multiple clones of an entity.

    IsComponentEnabled(Entity, ComponentType)

    Checks whether a given ComponentType is enabled on the specified Entity.

    IsComponentEnabled<T>(Entity)

    Checks whether a given ComponentType is enabled on the specified Entity.

    RemoveComponent(Entity, ComponentType)

    Removes a component from an entity.

    SetComponentData<T>(Entity, T)

    Sets the value of a component of an entity.

    SetComponentEnabled(Entity, ComponentType, bool)

    Enable or disable ComponentType on the specified Entity.

    SetComponentEnabled<T>(Entity, bool)

    Enable or disable a ComponentType on the specified Entity.

    SetSharedComponentData<T>(Entity, T)

    Obsolete. Use SetSharedComponentManaged<T>(Entity, T) instead.

    SetSharedComponentManaged<T>(NativeArray<Entity>, T)

    Sets the shared component on an array of entities

    SetSharedComponentManaged<T>(Entity, T)

    Sets the shared component of an entity.

    SetSharedComponent<T>(NativeArray<Entity>, T)

    Sets the shared component value on an array of entities

    SetSharedComponent<T>(Entity, T)

    Sets the shared component of an entity.

    SwapComponents(ArchetypeChunk, int, ArchetypeChunk, int)

    Swaps the components of two entities.

    See Also

    BeginExclusiveEntityTransaction()
    EndExclusiveEntityTransaction()
    In This Article
    Back to top
    Copyright © 2024 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)