コード例 #1
0
        public bool RemoveComponent <T>(Entity entity) where T : struct, IComponentData
        {
            switch (Type)
            {
            case EntityManagerType.ENTITY_MANAGER:
                return(EntityManager.RemoveComponent <T>(entity));

            case EntityManagerType.ENTITY_COMMAND_BUFFER:
            case EntityManagerType.ENTITY_MANAGER_AND_COMMAND_BUFFER:
                EntityCommandBuffer.RemoveComponent <T>(entity);
                return(true);

            case EntityManagerType.ENTITY_COMMAND_BUFFER_CONCURRENT:
                EntityCommandBufferConcurrent.RemoveComponent <T>(EntityCommandBufferJobIndex, entity);
                return(true);
            }

            throw new NotImplementedException();
        }
コード例 #2
0
        public bool RemoveComponent(Entity entity, ComponentType componentType)
        {
            switch (Type)
            {
            case EntityManagerType.MOCK:
                return(false);

            case EntityManagerType.ENTITY_MANAGER:
                return(EntityManager.RemoveComponent(entity, componentType));

            case EntityManagerType.ENTITY_COMMAND_BUFFER:
            case EntityManagerType.ENTITY_MANAGER_AND_COMMAND_BUFFER:
                EntityCommandBuffer.RemoveComponent(entity, componentType);
                return(true);

            case EntityManagerType.ENTITY_COMMAND_BUFFER_CONCURRENT:
                EntityCommandBufferConcurrent.RemoveComponent(EntityCommandBufferJobIndex, entity, componentType);
                return(true);
            }

            throw new NotImplementedException();
        }