A* Pathfinding Project  4.3.7
The A* Pathfinding Project for Unity 3D
GridGraphRules Class Reference

Container for all rules in a grid graph. More...

Detailed Description

Container for all rules in a grid graph.

// Get the first grid graph in the scene
var gridGraph = AstarPath.active.data.gridGraph;
gridGraph.rules.rules.Add(new RuleAnglePenalty {
penaltyScale = 10000,
curve = AnimationCurve.Linear(0, 0, 90, 1),
});
See also
Pathfinding.GridGraph.rules
Grid Graph Rules

Classes

class  Context
 Context for when scanning or updating a graph. More...
 

Public Member Functions

void Add (GridGraphRule.Pass rule, System.Action< Context > action)
 
void DisposeUnmanagedData ()
 
bool ExecuteRule (GridGraphRule.Pass rule, Context context)
 
void Rebuild ()
 
void RebuildIfNecessary ()
 

Public Attributes

List< GridGraphRulerules = new List<GridGraphRule>()
 List of all rules. More...
 

Private Member Functions

long Hash ()
 

Private Attributes

List< System.Action< Context > > [] callbacks
 
long lastHash
 

Member Function Documentation

◆ Add()

void Add ( GridGraphRule.Pass  rule,
System.Action< Context action 
)

◆ DisposeUnmanagedData()

void DisposeUnmanagedData ( )

◆ ExecuteRule()

bool ExecuteRule ( GridGraphRule.Pass  rule,
Context  context 
)

◆ Hash()

long Hash ( )
private

◆ Rebuild()

void Rebuild ( )

◆ RebuildIfNecessary()

void RebuildIfNecessary ( )

Member Data Documentation

◆ callbacks

List<System.Action<Context> > [] callbacks
private

◆ lastHash

long lastHash
private

◆ rules

List<GridGraphRule> rules = new List<GridGraphRule>()

List of all rules.


The documentation for this class was generated from the following file: