Ejemplo n.º 1
0
 public static JobHandle DestroyTransformHierarchy <T>(this ComponentSystemBase system, EntityQuery query, EntityCommandBuffer cmdBuffer, JobHandle inputDeps)
     where T : struct, IComponentData
 {
     return(new DestroyTransformHierarchy <T> {
         ChunkEntityType = system.GetEntityTypeHandle(),
         ChildrenFromEntity = system.GetBufferFromEntity <Child>(true),
         CmdBuffer = cmdBuffer.AsParallelWriter()
     }.Schedule(query, inputDeps));
 }
Ejemplo n.º 2
0
 public static JobHandle DestroyEntityOnly(
     this EntityQuery query,
     ComponentSystemBase system,
     EntityCommandBuffer entityCommandBuffer,
     JobHandle inputDeps)
 {
     return(new DestroyEntitiesOnly {
         CmdBuffer = entityCommandBuffer.AsParallelWriter(),
         EntityOnlyArchetype = system.EntityManager.CreateArchetype(),
         EntityType = system.GetEntityTypeHandle()
     }.Schedule(query, inputDeps));
 }
Ejemplo n.º 3
0
 public static JobHandle CopyFromChangedComponentData <T>(
     this EntityQuery query,
     ComponentSystemBase system,
     ref NativeHashMap <Entity, T> resultChangedComponentData,
     JobHandle inputDeps)
     where T : struct, IComponentData
 {
     inputDeps = new CopyFromChangedComponentData <T> {
         EntityType           = system.GetEntityTypeHandle(),
         ChunkType            = system.GetComponentTypeHandle <T>(false),
         ChangedComponentData = resultChangedComponentData
     }.Schedule(query, inputDeps);
     return(inputDeps);
 }
        public static LayerChunkTypeGroup BuildLayerChunkTypeGroup(ComponentSystemBase system)
        {
            LayerChunkTypeGroup result = new LayerChunkTypeGroup
            {
                collider     = system.GetComponentTypeHandle <Collider>(true),
                translation  = system.GetComponentTypeHandle <Translation>(true),
                rotation     = system.GetComponentTypeHandle <Rotation>(true),
                scale        = system.GetComponentTypeHandle <PhysicsScale>(true),
                parent       = system.GetComponentTypeHandle <Parent>(true),
                localToWorld = system.GetComponentTypeHandle <LocalToWorld>(true),
                entity       = system.GetEntityTypeHandle()
            };

            return(result);
        }
Ejemplo n.º 5
0
 public static JobHandle ToDataWithEntity <TData>(
     this EntityQuery entityQuery,
     ComponentSystemBase system,
     NativeArray <TData> sourceData,
     ref NativeArray <DataWithEntity <TData> > resultDataWithEntity,
     JobHandle inputDeps)
     where TData : struct, IComparable <TData>
 {
     inputDeps = new ConvertToDataWithEntity <TData> {
         ChunkEntityType = system.GetEntityTypeHandle(),
         Source          = sourceData,
         Target          = resultDataWithEntity
     }.Schedule(entityQuery, inputDeps);
     return(inputDeps);
 }
Ejemplo n.º 6
0
 public static JobHandle GetChangedComponentDataFromEntity <T>(
     this EntityQuery query,
     ComponentSystemBase system,
     ref NativeHashMap <Entity, T> resultHashMap,
     JobHandle inputDeps)
     where T : struct, IComponentData
 {
     inputDeps = resultHashMap.Clear(inputDeps, query.CalculateEntityCount());
     inputDeps = new ChangedComponentToEntity <T> {
         EntityType        = system.GetEntityTypeHandle(),
         ChunkType         = system.GetComponentTypeHandle <T>(true),
         ChangedComponents = resultHashMap.AsParallelWriter(),
         LastSystemVersion = system.LastSystemVersion
     }.Schedule(query, inputDeps);
     return(inputDeps);
 }
Ejemplo n.º 7
0
 public void BeginSerialize(ComponentSystemBase system, NativeArray <ArchetypeChunk> chunks)
 {
     AllChunks  = chunks;
     GhostType  = system.GetComponentTypeHandle <GhostIdentifier>();
     EntityType = system.GetEntityTypeHandle();
 }
Ejemplo n.º 8
0
 public void ScheduleTimeInitialize(ComponentSystemBase jobComponentSystem, bool isReadOnly)
 {
     _typeHandle = jobComponentSystem.GetEntityTypeHandle();
 }