Exemplo n.º 1
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new OverlapJob
        {
            ObstacleTranslationArray = _obstacleQuery.ToComponentDataArray <Translation>(Allocator.TempJob),
            ObstacleColliderArray    = _obstacleQuery.ToComponentDataArray <BoxColliderComponent>(Allocator.TempJob)
        }.Schedule(this, inputDeps);

        return(job);
    }
        public JobHandle OverlapDetection(ref OverlapAabbInput input, ref NativeList <Entity> entities)
        {
            var resultIndices = new NativeList <int>(1, Allocator.TempJob);
            var handle        = new OverlapJob
            {
                World          = m_physicsWorldSystem.PhysicsWorld.CollisionWorld,
                OverlapInput   = input,
                ResultIndices  = resultIndices,
                ResultEntities = entities,
            }.Schedule();

            handle.Complete();
            resultIndices.Dispose(handle);
            return(handle);
        }