Class EntityManager | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class EntityManager

    Inheritance
    System.Object
    ScriptBehaviourManager
    EntityManager
    Inherited Members
    ScriptBehaviourManager.Update()
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Unity.Entities
    Syntax
    public sealed class EntityManager : ScriptBehaviourManager

    Properties

    Debug

    Declaration
    public EntityManager.EntityManagerDebug Debug { get; }
    Property Value
    Type Description
    EntityManager.EntityManagerDebug

    EntityCapacity

    Declaration
    public int EntityCapacity { get; set; }
    Property Value
    Type Description
    System.Int32

    ExclusiveEntityTransactionDependency

    Declaration
    public JobHandle ExclusiveEntityTransactionDependency { get; set; }
    Property Value
    Type Description
    JobHandle

    GlobalSystemVersion

    Declaration
    public uint GlobalSystemVersion { get; }
    Property Value
    Type Description
    System.UInt32

    IsCreated

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

    Version

    Declaration
    public int Version { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    AddComponent(Entity, ComponentType)

    Declaration
    public void AddComponent(Entity entity, ComponentType type)
    Parameters
    Type Name Description
    Entity entity
    ComponentType type

    AddComponentData<T>(Entity, T)

    Declaration
    public void AddComponentData<T>(Entity entity, T componentData)where T : struct, IComponentData
    Parameters
    Type Name Description
    Entity entity
    T componentData
    Type Parameters
    Name Description
    T

    AddMatchingArchetypes(ComponentType[], ComponentType[], ComponentType[], NativeList<EntityArchetype>)

    Declaration
    public void AddMatchingArchetypes(ComponentType[] anyComponentTypes, ComponentType[] noneComponentTypes, ComponentType[] allComponentTypes, NativeList<EntityArchetype> foundArchetypes)
    Parameters
    Type Name Description
    ComponentType[] anyComponentTypes
    ComponentType[] noneComponentTypes
    ComponentType[] allComponentTypes
    NativeList<EntityArchetype> foundArchetypes

    AddSharedComponentData<T>(Entity, T)

    Declaration
    public void AddSharedComponentData<T>(Entity entity, T componentData)where T : struct, ISharedComponentData
    Parameters
    Type Name Description
    Entity entity
    T componentData
    Type Parameters
    Name Description
    T

    BeginExclusiveEntityTransaction()

    Declaration
    public ExclusiveEntityTransaction BeginExclusiveEntityTransaction()
    Returns
    Type Description
    ExclusiveEntityTransaction

    CheckInternalConsistency()

    Declaration
    public void CheckInternalConsistency()

    CompleteAllJobs()

    Declaration
    public void CompleteAllJobs()

    CreateArchetype(ComponentType[])

    Declaration
    public EntityArchetype CreateArchetype(params ComponentType[] types)
    Parameters
    Type Name Description
    ComponentType[] types
    Returns
    Type Description
    EntityArchetype

    CreateArchetypeChunkArray(NativeList<EntityArchetype>, Allocator)

    Declaration
    public ArchetypeChunkArray CreateArchetypeChunkArray(NativeList<EntityArchetype> archetypes, Allocator allocator)
    Parameters
    Type Name Description
    NativeList<EntityArchetype> archetypes
    Allocator allocator
    Returns
    Type Description
    ArchetypeChunkArray

    CreateArchetypeChunkArray(ComponentType[], ComponentType[], ComponentType[], Allocator)

    Declaration
    public ArchetypeChunkArray CreateArchetypeChunkArray(ComponentType[] anyComponentTypes, ComponentType[] noneComponentTypes, ComponentType[] allComponentTypes, Allocator allocator)
    Parameters
    Type Name Description
    ComponentType[] anyComponentTypes
    ComponentType[] noneComponentTypes
    ComponentType[] allComponentTypes
    Allocator allocator
    Returns
    Type Description
    ArchetypeChunkArray

    CreateEntity(ComponentType[])

    Declaration
    public Entity CreateEntity(params ComponentType[] types)
    Parameters
    Type Name Description
    ComponentType[] types
    Returns
    Type Description
    Entity

    CreateEntity(EntityArchetype)

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

    CreateEntity(EntityArchetype, NativeArray<Entity>)

    Declaration
    public void CreateEntity(EntityArchetype archetype, NativeArray<Entity> entities)
    Parameters
    Type Name Description
    EntityArchetype archetype
    NativeArray<Entity> entities

    DestroyEntity(NativeArray<Entity>)

    Declaration
    public void DestroyEntity(NativeArray<Entity> entities)
    Parameters
    Type Name Description
    NativeArray<Entity> entities

    DestroyEntity(NativeSlice<Entity>)

    Declaration
    public void DestroyEntity(NativeSlice<Entity> entities)
    Parameters
    Type Name Description
    NativeSlice<Entity> entities

    DestroyEntity(ComponentGroup)

    Declaration
    public void DestroyEntity(ComponentGroup componentGroupFilter)
    Parameters
    Type Name Description
    ComponentGroup componentGroupFilter

    DestroyEntity(Entity)

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

    EndExclusiveEntityTransaction()

    Declaration
    public void EndExclusiveEntityTransaction()

    Exists(Entity)

    Declaration
    public bool Exists(Entity entity)
    Parameters
    Type Name Description
    Entity entity
    Returns
    Type Description
    System.Boolean

    GetAllEntities(Allocator)

    Declaration
    public NativeArray<Entity> GetAllEntities(Allocator allocator = null)
    Parameters
    Type Name Description
    Allocator allocator
    Returns
    Type Description
    NativeArray<Entity>

    GetAllUniqueSharedComponentDatas<T>(List<T>)

    Declaration
    public void GetAllUniqueSharedComponentDatas<T>(List<T> sharedComponentValues)where T : struct, ISharedComponentData
    Parameters
    Type Name Description
    List<T> sharedComponentValues
    Type Parameters
    Name Description
    T

    GetArchetypeChunkComponentType<T>(Boolean)

    Declaration
    public ArchetypeChunkComponentType<T> GetArchetypeChunkComponentType<T>(bool isReadOnly)where T : struct, IComponentData
    Parameters
    Type Name Description
    System.Boolean isReadOnly
    Returns
    Type Description
    ArchetypeChunkComponentType<T>
    Type Parameters
    Name Description
    T

    GetArchetypeChunkEntityType(Boolean)

    Declaration
    public ArchetypeChunkEntityType GetArchetypeChunkEntityType(bool isReadOnly)
    Parameters
    Type Name Description
    System.Boolean isReadOnly
    Returns
    Type Description
    ArchetypeChunkEntityType

    GetArchetypeChunkSharedComponentType<T>(Boolean)

    Declaration
    public ArchetypeChunkSharedComponentType<T> GetArchetypeChunkSharedComponentType<T>(bool isReadOnly)where T : struct, ISharedComponentData
    Parameters
    Type Name Description
    System.Boolean isReadOnly
    Returns
    Type Description
    ArchetypeChunkSharedComponentType<T>
    Type Parameters
    Name Description
    T

    GetAssignableComponentTypes(Type)

    Declaration
    public List<Type> GetAssignableComponentTypes(Type interfaceType)
    Parameters
    Type Name Description
    System.Type interfaceType
    Returns
    Type Description
    List<System.Type>

    GetComponentCount(Entity)

    Declaration
    public int GetComponentCount(Entity entity)
    Parameters
    Type Name Description
    Entity entity
    Returns
    Type Description
    System.Int32

    GetComponentData<T>(Entity)

    Declaration
    public T GetComponentData<T>(Entity entity)where T : struct, IComponentData
    Parameters
    Type Name Description
    Entity entity
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    GetComponentDataFromEntity<T>(Boolean)

    Declaration
    public ComponentDataFromEntity<T> GetComponentDataFromEntity<T>(bool isReadOnly = false)where T : struct, IComponentData
    Parameters
    Type Name Description
    System.Boolean isReadOnly
    Returns
    Type Description
    ComponentDataFromEntity<T>
    Type Parameters
    Name Description
    T

    GetComponentOrderVersion<T>()

    Declaration
    public int GetComponentOrderVersion<T>()
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T

    GetComponentTypes(Entity, Allocator)

    Declaration
    public NativeArray<ComponentType> GetComponentTypes(Entity entity, Allocator allocator = null)
    Parameters
    Type Name Description
    Entity entity
    Allocator allocator
    Returns
    Type Description
    NativeArray<ComponentType>

    GetFixedArray<T>(Entity)

    Declaration
    public NativeArray<T> GetFixedArray<T>(Entity entity)where T : struct
    Parameters
    Type Name Description
    Entity entity
    Returns
    Type Description
    NativeArray<T>
    Type Parameters
    Name Description
    T

    GetSharedComponentData<T>(Entity)

    Declaration
    public T GetSharedComponentData<T>(Entity entity)where T : struct, ISharedComponentData
    Parameters
    Type Name Description
    Entity entity
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    GetSharedComponentOrderVersion<T>(T)

    Declaration
    public int GetSharedComponentOrderVersion<T>(T sharedComponent)where T : struct, ISharedComponentData
    Parameters
    Type Name Description
    T sharedComponent
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T

    HasComponent(Entity, ComponentType)

    Declaration
    public bool HasComponent(Entity entity, ComponentType type)
    Parameters
    Type Name Description
    Entity entity
    ComponentType type
    Returns
    Type Description
    System.Boolean

    HasComponent<T>(Entity)

    Declaration
    public bool HasComponent<T>(Entity entity)
    Parameters
    Type Name Description
    Entity entity
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    T

    Instantiate(Entity)

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

    Instantiate(Entity, NativeArray<Entity>)

    Declaration
    public void Instantiate(Entity srcEntity, NativeArray<Entity> outputEntities)
    Parameters
    Type Name Description
    Entity srcEntity
    NativeArray<Entity> outputEntities

    MoveEntitiesFrom(EntityManager)

    Declaration
    public void MoveEntitiesFrom(EntityManager srcEntities)
    Parameters
    Type Name Description
    EntityManager srcEntities

    OnAfterDestroyManagerInternal()

    Declaration
    protected override void OnAfterDestroyManagerInternal()
    Overrides
    ScriptBehaviourManager.OnAfterDestroyManagerInternal()

    OnBeforeCreateManagerInternal(World, Int32)

    Declaration
    protected override void OnBeforeCreateManagerInternal(World world, int capacity)
    Parameters
    Type Name Description
    World world
    System.Int32 capacity
    Overrides
    ScriptBehaviourManager.OnBeforeCreateManagerInternal(World, Int32)

    OnBeforeDestroyManagerInternal()

    Declaration
    protected override void OnBeforeDestroyManagerInternal()
    Overrides
    ScriptBehaviourManager.OnBeforeDestroyManagerInternal()

    OnCreateManager(Int32)

    Declaration
    protected override void OnCreateManager(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity
    Overrides
    ScriptBehaviourManager.OnCreateManager(Int32)

    OnDestroyManager()

    Declaration
    protected override void OnDestroyManager()
    Overrides
    ScriptBehaviourManager.OnDestroyManager()

    RemoveComponent(Entity, ComponentType)

    Declaration
    public void RemoveComponent(Entity entity, ComponentType type)
    Parameters
    Type Name Description
    Entity entity
    ComponentType type

    RemoveComponent<T>(Entity)

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

    RemoveComponents(Entity)

    Declaration
    public void RemoveComponents(Entity entity)
    Parameters
    Type Name Description
    Entity entity

    RemoveSystemStateComponent(Entity, ComponentType)

    Declaration
    public void RemoveSystemStateComponent(Entity entity, ComponentType type)
    Parameters
    Type Name Description
    Entity entity
    ComponentType type

    RemoveSystemStateComponent<T>(Entity)

    Declaration
    public void RemoveSystemStateComponent<T>(Entity entity)
    Parameters
    Type Name Description
    Entity entity
    Type Parameters
    Name Description
    T

    SetComponentData<T>(Entity, T)

    Declaration
    public void SetComponentData<T>(Entity entity, T componentData)where T : struct, IComponentData
    Parameters
    Type Name Description
    Entity entity
    T componentData
    Type Parameters
    Name Description
    T

    SetSharedComponentData<T>(Entity, T)

    Declaration
    public void SetSharedComponentData<T>(Entity entity, T componentData)where T : struct, ISharedComponentData
    Parameters
    Type Name Description
    Entity entity
    T componentData
    Type Parameters
    Name Description
    T
    In This Article
    • Properties
      • Debug
      • EntityCapacity
      • ExclusiveEntityTransactionDependency
      • GlobalSystemVersion
      • IsCreated
      • Version
    • Methods
      • AddComponent(Entity, ComponentType)
      • AddComponentData<T>(Entity, T)
      • AddMatchingArchetypes(ComponentType[], ComponentType[], ComponentType[], NativeList<EntityArchetype>)
      • AddSharedComponentData<T>(Entity, T)
      • BeginExclusiveEntityTransaction()
      • CheckInternalConsistency()
      • CompleteAllJobs()
      • CreateArchetype(ComponentType[])
      • CreateArchetypeChunkArray(NativeList<EntityArchetype>, Allocator)
      • CreateArchetypeChunkArray(ComponentType[], ComponentType[], ComponentType[], Allocator)
      • CreateEntity(ComponentType[])
      • CreateEntity(EntityArchetype)
      • CreateEntity(EntityArchetype, NativeArray<Entity>)
      • DestroyEntity(NativeArray<Entity>)
      • DestroyEntity(NativeSlice<Entity>)
      • DestroyEntity(ComponentGroup)
      • DestroyEntity(Entity)
      • EndExclusiveEntityTransaction()
      • Exists(Entity)
      • GetAllEntities(Allocator)
      • GetAllUniqueSharedComponentDatas<T>(List<T>)
      • GetArchetypeChunkComponentType<T>(Boolean)
      • GetArchetypeChunkEntityType(Boolean)
      • GetArchetypeChunkSharedComponentType<T>(Boolean)
      • GetAssignableComponentTypes(Type)
      • GetComponentCount(Entity)
      • GetComponentData<T>(Entity)
      • GetComponentDataFromEntity<T>(Boolean)
      • GetComponentOrderVersion<T>()
      • GetComponentTypes(Entity, Allocator)
      • GetFixedArray<T>(Entity)
      • GetSharedComponentData<T>(Entity)
      • GetSharedComponentOrderVersion<T>(T)
      • HasComponent(Entity, ComponentType)
      • HasComponent<T>(Entity)
      • Instantiate(Entity)
      • Instantiate(Entity, NativeArray<Entity>)
      • MoveEntitiesFrom(EntityManager)
      • OnAfterDestroyManagerInternal()
      • OnBeforeCreateManagerInternal(World, Int32)
      • OnBeforeDestroyManagerInternal()
      • OnCreateManager(Int32)
      • OnDestroyManager()
      • RemoveComponent(Entity, ComponentType)
      • RemoveComponent<T>(Entity)
      • RemoveComponents(Entity)
      • RemoveSystemStateComponent(Entity, ComponentType)
      • RemoveSystemStateComponent<T>(Entity)
      • SetComponentData<T>(Entity, T)
      • SetSharedComponentData<T>(Entity, T)
    Back to top
    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