public Entity CreateEntity() { switch (Type) { case EntityManagerType.ENTITY_MANAGER: return(EntityManager.CreateEntity()); case EntityManagerType.ENTITY_COMMAND_BUFFER: return(EntityCommandBuffer.CreateEntity()); case EntityManagerType.ENTITY_COMMAND_BUFFER_CONCURRENT: return(EntityCommandBufferConcurrent.CreateEntity(EntityCommandBufferJobIndex)); } throw new NotImplementedException(); }
public Entity CreateEntityFromArchetype <T>() where T : IArchetypeDescriptor { var archetype = EntityArchetypeManager.Instance.GetOrCreateArchetype <T>(); switch (Type) { case EntityManagerType.ENTITY_MANAGER: return(EntityManager.CreateEntity(archetype)); case EntityManagerType.ENTITY_COMMAND_BUFFER: case EntityManagerType.ENTITY_MANAGER_AND_COMMAND_BUFFER: return(EntityCommandBuffer.CreateEntity(archetype)); case EntityManagerType.ENTITY_COMMAND_BUFFER_CONCURRENT: return(EntityCommandBufferConcurrent.CreateEntity(EntityCommandBufferJobIndex, archetype)); } throw new NotImplementedException(); }
public Entity CreateEntityFromArchetype(EntityArchetype archetype) { switch (Type) { case EntityManagerType.MOCK: return(Entity.Null); case EntityManagerType.ENTITY_MANAGER: return(EntityManager.CreateEntity(archetype)); case EntityManagerType.ENTITY_COMMAND_BUFFER: case EntityManagerType.ENTITY_MANAGER_AND_COMMAND_BUFFER: return(EntityCommandBuffer.CreateEntity(archetype)); case EntityManagerType.ENTITY_COMMAND_BUFFER_CONCURRENT: return(EntityCommandBufferConcurrent.CreateEntity(EntityCommandBufferJobIndex, archetype)); } throw new NotImplementedException(); }