Ejemplo n.º 1
0
    void Tick()
    {
        NativeArray <float3> orients     = new NativeArray <float3>(4, Allocator.TempJob);
        NativeArray <int>    trueResults = new NativeArray <int>(4, Allocator.TempJob);

        for (int i = 0; i < 4; i++)
        {
            orients[i] = orientations[i];
        }
        PathWalker pathWalker = new PathWalker {
            delta        = Time.deltaTime,
            grid         = RecursiveBacktracking.hashGrid,
            mazeWidth    = mazeWidth,
            orientations = orients,
            trueResults  = trueResults,
            seed         = (uint)math.abs(Time.time * 23423)
        };
        JobHandle pathWalkerJobHandle = pathWalker.Schedule(this);

        pathWalkerJobHandle.Complete();
        orients.Dispose();
        trueResults.Dispose();
    }