private static void BuildPrefabAndLinkedEntityGroupLookups( EntityManager entityManager, EntityQuery entityQuery, EntityQuery prefabQuery, EntityQuery linkedEntityGroupQuery, NativeHashMap <EntityGuid, Entity> entityGuidToPrefab, NativeHashMap <Entity, Entity> entityToLinkedEntityGroupRoot) { var buildPrefabLookups = new BuildComponentToEntityHashMap <EntityGuid> { EntityType = entityManager.GetArchetypeChunkEntityType(), ComponentType = entityManager.GetArchetypeChunkComponentType <EntityGuid>(true), ComponentToEntity = entityGuidToPrefab.AsParallelWriter() }.Schedule(prefabQuery); var buildLinkedEntityGroupLookups = new BuildLinkedEntityGroupHashMap { EntityToLinkedEntityGroupRoot = entityToLinkedEntityGroupRoot.AsParallelWriter(), LinkedEntityGroupType = entityManager.GetArchetypeChunkBufferType <LinkedEntityGroup>(true) }.Schedule(linkedEntityGroupQuery); JobHandle.CombineDependencies(buildPrefabLookups, buildLinkedEntityGroupLookups).Complete(); }
public ArchetypeChunkBufferType <T> GetArchetypeChunkBufferType <T>(bool isReadOnly = false) where T : struct, IBufferElementData { AddReaderWriter(isReadOnly ? ComponentType.ReadOnly <T>() : ComponentType.ReadWrite <T>()); return(EntityManager.GetArchetypeChunkBufferType <T>(isReadOnly)); }