Beispiel #1
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new TriggerEventJob
        {
            cars          = GetComponentDataFromEntity <CarTag>(),
            projectiles   = GetComponentDataFromEntity <ProjectileTag>(),
            powerups      = GetComponentDataFromEntity <PowerupTag>(),
            walls         = GetComponentDataFromEntity <WallTag>(),
            missiles      = GetComponentDataFromEntity <MissileTag>(),
            roads         = GetComponentDataFromEntity <RoadTag>(),
            checkpoints   = GetComponentDataFromEntity <CheckpointTag>(),
            commandBuffer = commandBufferSystem.CreateCommandBuffer()
        }.Schedule(stepPhysicsWorld.Simulation, ref buildPhysicsWorld.PhysicsWorld, inputDeps);

        commandBufferSystem.AddJobHandleForProducer(job);
        return(job);
    }
Beispiel #2
0
    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        ComponentDataFromEntity <ShipCollisionMask> shipCollisionMaskFromEntity = GetComponentDataFromEntity <ShipCollisionMask>(true);
        ComponentDataFromEntity <ShipCollision>     shipCollisionFromEntity     = GetComponentDataFromEntity <ShipCollision>();

        var commandBuffer = m_Barrier.CreateCommandBuffer();

        var jobHandle = new TriggerEventJob()
        {
            CollisionMaskGroup = GetComponentDataFromEntity <ShipCollisionMask>(true),
            CollisionGroup     = GetComponentDataFromEntity <ShipCollision>(),
            CommandBuffer      = commandBuffer
        }.Schedule(stepPhysicsWorldSystem.Simulation,
                   ref physicsWorldSystem.PhysicsWorld, inputDependencies);

        m_Barrier.AddJobHandleForProducer(jobHandle);

        return(jobHandle);
    }
Beispiel #3
0
        protected override void OnUpdate()
        {
            // Job, get currently colliding blocks
            this.triggerEntities.Clear();
            TriggerEventJob triggerEventJob = new TriggerEventJob()
            {
                playerGroup        = GetComponentDataFromEntity <Tag_Player>(true),
                blockGroup         = GetComponentDataFromEntity <BlockPlayerCollisionData>(true),
                outTriggerEntities = triggerEntities,
            };
            JobHandle triggerEventJobHandle = triggerEventJob.Schedule(this.stepPhysicsWorldSystem.Simulation, ref this.buildPhysicsWorldSystem.PhysicsWorld, this.Dependency);

            // Job, update block trigger state
            UpdateBlockTriggerStateJob updateBlockTriggerStateJob = new UpdateBlockTriggerStateJob()
            {
                triggerEntities          = triggerEntities,
                blockPlayerCollisionType = GetArchetypeChunkComponentType <BlockPlayerCollisionData>(false),
                entityType = GetArchetypeChunkEntityType(),
            };
            JobHandle updateBlockTriggerStateJobHandle = updateBlockTriggerStateJob.ScheduleParallel(this.blockQuery, triggerEventJobHandle);

            this.Dependency = updateBlockTriggerStateJobHandle;
        }