• Articles
  • Api Documentation
Show / Hide Table of Contents
  • AnyPath
    • Graphs
      • Extra
        • Line2D
        • Line3D
        • Triangle
      • HexGrid
        • HexGrid
        • HexGrid.Enumerator
        • HexGridCell
        • HexGridHeuristicProvider
        • HexGridType
      • Line
        • ClosestLineLocationPredicate
        • LineGraph
        • LineGraph.Edge
        • LineGraph.Enumerator
        • LineGraphBuilder
        • LineGraphBuilder.ProtoEdge
        • LineGraphDrawer
        • LineGraphHeuristic
        • LineGraphLocation
        • LineGraphPopulator
        • LineGraphProcessor
        • LineGraphWelder
        • SceneGraph
          • LineGraphNode
          • LineSceneGraph
          • LineSceneGraphEdge
          • SceneGraphNodeEditor
      • NavMesh
        • ClosestNavMeshLocationPredicate
        • CornerAndNormal
        • IUnrolledNavMeshGraphPortal
        • NavMeshGraph
        • NavMeshGraph.EnterCostAndFlags
        • NavMeshGraph.Enumerator
        • NavMeshGraphCorners
        • NavMeshGraphCorners3D
        • NavMeshGraphHeuristic
        • NavMeshGraphLocation
        • NavMeshGraphUnroller
        • NavMeshLineBitmaskMod
        • NavMeshLineMod
        • NavMeshPlaneBitmaskMod
        • NavMeshPlaneMod
        • NavMeshPopulator
        • NavMeshWelder
        • SSFA
        • UnrolledNavMeshGraphPortal
      • Node
        • NodeGraph
        • NodeGraphNode
      • PlatformerGraph
        • ClosestPlatformerGraphLocationPredicate
        • PlatformerGraph
        • PlatformerGraph.Enumerator
        • PlatformerGraphBuilder
        • PlatformerGraphBuilder.ProtoEdge
        • PlatformerGraphDrawer
        • PlatformerGraphHeuristic
        • PlatformerGraphLocation
        • PlatformerGraphPopulator
        • PlatformerGraphProcessor
        • PlatformerGraphWelder
        • SceneGraph
          • PlatformerSceneGraph
          • PlatformerSceneGraphEdge
          • PlatformerSceneGraphNode
          • SceneGraphNodeEditor
      • SquareGrid
        • SquareGrid
        • SquareGrid.Enumerator
        • SquareGridCell
        • SquareGridHeuristicProvider
        • SquareGridHeuristicProviderEightDirectional
        • SquareGridHeuristicProviderManhattanDistance
        • SquareGridType
      • VoxelGrid
        • VoxelGrid
        • VoxelGrid.DirCost
        • VoxelGrid.Enumerator
        • VoxelGridCell
        • VoxelGridDirectionFlags
        • VoxelGridDirectionMod
        • VoxelGridHeuristicProvider
        • VoxelGridHeuristicProviderManhattanDistance
    • Managed
      • ClearFinderFlags
      • FinderExtensions
      • IFinder
      • IOptionReserver<TOption>
      • IOptionValidator<TOption>
      • ImmutableFinderException
      • ManagedDisposeExtensions
      • Results
        • DijkstraResult<TNode>
        • Eval
        • Eval<TOption>
        • MultiEvalResult
        • MultiPathResult<TSeg>
        • Path<TSeg>
        • Path<TOption, TSeg>
    • Native
      • AStarCheapestOption
      • AStarEvalOptionResult
      • AStarEvalResult
      • AStarFindOptionResult
      • AStarFindPathResult
      • AStarOption
      • AStarStops
      • AStar<TNode>
      • ComposedGraph<TGraph, TNode>
      • Edge<TNode>
      • FlagBitmask<TNode>
      • IEdgeMod<TNode>
      • IGraph<TNode>
      • IHeuristicProvider<TNode>
      • INodeFlags
      • IPathProcessor<TNode, TSeg>
      • NativeListWrapper<TSeg>
      • NoEdgeMod<TNode>
      • NoProcessing<TNode>
      • OffsetInfo
      • ReversedGraph<TNode>
      • EdgeMods
        • AdditionalAndExcludeEdges<TNode>
        • AdditionalEdges<TNode>
        • ExcludeEdges<TNode>
        • ExcludeLocations<TNode>
      • Heuristics
        • ALTCompute<TGraph, TNode>
        • ALTSerialization
        • ALT<TNode>
        • LandmarkSelection<TGraph, TNode, TEnumerator>
      • Util
        • IRefComparer<T>
        • NativeMinHeap<T, TComp>
        • NativeRefMinHeap<T, TComp>

Class PlatformerGraphPopulator

Utility to populate PlatformerGraph using Unity's Job system. This can be useful if you have frequent updates and want this process to be as fast as possible and/or on another thread.

Inheritance
object
PlatformerGraphPopulator
Namespace: AnyPath.Graphs.PlatformerGraph
Assembly: AnyPath.dll
Syntax
public static class PlatformerGraphPopulator
Remarks

Works in the same manner as the NavMeshPopulator

Methods

SchedulePopulate(PlatformerGraph, NativeArray<float2>, NativeArray<Edge>, NativeArray<Edge>, JobHandle)

Schedules a job that populates the PlatformerGraph with undirected edges and directed edges

Declaration
public static JobHandle SchedulePopulate(this PlatformerGraph graph, NativeArray<float2> vertices, NativeArray<PlatformerGraph.Edge> undirectedEdges, NativeArray<PlatformerGraph.Edge> directedEdges, JobHandle dependsOn = default)
Parameters
Type Name Description
PlatformerGraph graph
NativeArray<float2> vertices
NativeArray<PlatformerGraph.Edge> undirectedEdges
NativeArray<PlatformerGraph.Edge> directedEdges
JobHandle dependsOn
Returns
Type Description
JobHandle
Examples
// Example on how to weld vertices and populate the PlatformerGraph using Unity's Job system
// these NativeLists and arrays will be modified in place
var weldHandle = PlatformerGraphWelder.ScheduleWeld(vertices, directedEdges, undirectedEdges);

// Schedule the populate job with a dependency on the weld job handle
// Pass in the welded verts as a deffered array
var populateHandle =
    PlatformerGraphPopulator.SchedulePopulate(graph, vertices.AsDeferredJobArray(), undirectedEdges, directedEdges, weldHandle);

// complete the job, or wait for the result somewhere else
populateHandle.Complete();

SchedulePopulate(PlatformerGraph, NativeArray<float2>, NativeArray<Edge>, JobHandle)

Schedules a job that populates the PlatformerGraph with only undirected edges

Declaration
public static JobHandle SchedulePopulate(this PlatformerGraph graph, NativeArray<float2> vertices, NativeArray<PlatformerGraph.Edge> undirectedEdges, JobHandle dependsOn = default)
Parameters
Type Name Description
PlatformerGraph graph
NativeArray<float2> vertices
NativeArray<PlatformerGraph.Edge> undirectedEdges
JobHandle dependsOn
Returns
Type Description
JobHandle
Examples
// Example on how to weld vertices and populate the PlatformerGraph using Unity's Job system
// these NativeLists and arrays will be modified in place
var weldHandle = PlatformerGraphWelder.ScheduleWeld(vertices, directedEdges);

// Schedule the populate job with a dependency on the weld job handle
// Pass in the welded verts as a deffered array
var populateHandle =
    PlatformerGraphPopulator.SchedulePopulate(graph, vertices.AsDeferredJobArray(), undirectedEdges, weldHandle);

// complete the job, or wait for the result somewhere else
populateHandle.Complete();
In This Article
Back to top Generated by DocFX