Ejemplo n.º 1
0
 public static JobHandle ToEntityComponentMap <T>(
     this EntityQuery entityQuery,
     ref NativeHashMap <Entity, T> resultEntityComponentMap,
     JobHandle inputDeps)
     where T : struct, IComponentData
 {
     inputDeps = resultEntityComponentMap.Clear(inputDeps, entityQuery.CalculateEntityCountWithoutFiltering());
     inputDeps = new GatherEntityComponentMap <T> {
         Result = resultEntityComponentMap.AsParallelWriter()
     }.Schedule(entityQuery, inputDeps);
     return(inputDeps);
 }
Ejemplo n.º 2
0
 public static JobHandle ToEntityComponentMap <T>(
     this EntityQuery entityQuery,
     EntityManager entityManager,
     ref NativeHashMap <Entity, T> resultEntityComponentMap,
     JobHandle inputDeps)
     where T : struct, IComponentData
 {
     inputDeps = resultEntityComponentMap.Clear(inputDeps, entityQuery.CalculateEntityCountWithoutFiltering());
     inputDeps = new GatherEntityComponentMap <T> {
         ChunkEntityType = entityManager.GetArchetypeChunkEntityType(),
         ChunkDataType   = entityManager.GetArchetypeChunkComponentType <T>(true),
         Result          = resultEntityComponentMap.AsParallelWriter()
     }.Schedule(entityQuery, inputDeps);
     return(inputDeps);
 }