Ejemplo n.º 1
0
 protected override void OnUpdate()
 {
     NavMeshJob navMeshJob = new NavMeshJob
     {
     };
     JobHandle jobHandle = new JobHandle();
 }
Ejemplo n.º 2
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var queue  = new NativeQueue <int2>(Allocator.TempJob);
        var writer = queue.AsParallelWriter();

        var config = GetSingleton <Config>();
        var job    = new NavMeshJob
        {
            config       = config,
            physicsWorld = physicsWorldSystem.PhysicsWorld,
            queue        = writer
        };

        var unionJob = new UnionJob
        {
            queue = queue
        };

        var physicHandle = JobHandle.CombineDependencies(physicsWorldSystem.FinalJobHandle, inputDeps);
        var handle       = job.Schedule(config.cellWidth * config.cellHeight, 64, physicHandle);
        var resultHandle = unionJob.Schedule(this, handle);

        queue.Dispose();

        //resultHandle.Complete();
        return(resultHandle);
    }