Exemple #1
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new CollisionJob {
            projectiles   = GetComponentDataFromEntity <Projectile>(true),
            queuedActions = ProjectileImpactManager.queuedProjectileEvents.AsParallelWriter(),
            World         = buildPhysicsWorldSystem.PhysicsWorld,
        }.Schedule(stepPhysicsWorld.Simulation, ref buildPhysicsWorldSystem.PhysicsWorld, inputDeps);

        job.Complete();
        return(job);
    }
        protected override void OnUpdate()
        {
            if (EntityManager.CreateEntityQuery(typeof(Brick)).CalculateEntityCount() == 0)
            {
                return;
            }

            Dependency = new CollisionJob()
            {
                brickHealths = GetComponentDataFromEntity <HealthInt>()
            }.Schedule(m_StepPhysicsWorldSystem.Simulation,
                       ref m_BuildPhysicsWorldSystem.PhysicsWorld, Dependency);
            Dependency.Complete();
        }
    protected override void OnUpdate()
    {
        var colAngles = GetComponentDataFromEntity <ColAngle>(false);
        var ltw       = GetComponentDataFromEntity <LocalToWorld>(true);


        // Reset collision from prev. Frame
        Entities.ForEach((ref ColAngle colAngle) => {
            colAngle.Value = -1;
        }).Schedule();

        // Check for collision again.
        var collisionJob = new CollisionJob()
        {
            colAngles = colAngles,
            ltw       = ltw
        }.Schedule(stepPhysicsWorld.Simulation, ref buildPhysicsWorld.PhysicsWorld, Dependency);

        collisionJob.Complete();
    }