A* Pathfinding Project  4.1.16
The A* Pathfinding Project for Unity 3D
NodeLink3 Class Reference

Connects two TriangleMeshNodes (recast/navmesh graphs) as if they had shared an edge. More...

Detailed Description

Connects two TriangleMeshNodes (recast/navmesh graphs) as if they had shared an edge.

Note
Usually you do not want to use this type of link, you want to use NodeLink2 or NodeLink (sorry for the not so descriptive names).

Public Member Functions

void Apply (bool forceNewCheck)
 
void InternalOnPostScan ()
 
void OnDrawGizmos ()
 
void OnDrawGizmos (bool selected)
 
virtual void OnDrawGizmosSelected ()
 
override void OnGraphsPostUpdate ()
 Called after graphs have been updated using GraphUpdateObjects. More...
 
override void OnPostScan ()
 Called right after all graphs have been scanned. More...
 
- Public Member Functions inherited from GraphModifier
virtual void OnGraphsPreUpdate ()
 Called before graphs are updated using GraphUpdateObjects. More...
 
virtual void OnLatePostScan ()
 Called at the end of the scanning procedure. More...
 
virtual void OnPostCacheLoad ()
 Called after cached graphs have been loaded. More...
 
virtual void OnPreScan ()
 Called right before graphs are going to be scanned. More...
 

Static Public Member Functions

static NodeLink3 GetNodeLink (GraphNode node)
 
- Static Public Member Functions inherited from GraphModifier
static void FindAllModifiers ()
 
static void TriggerEvent (GraphModifier.EventType type)
 Triggers an event for all active graph modifiers. More...
 

Public Attributes

float costFactor = 1.0f
 The connection will be this times harder/slower to traverse. More...
 
Transform end
 End position of the link. More...
 
bool oneWay = false
 Make a one-way connection. More...
 

Protected Member Functions

override void OnDisable ()
 Removes this modifier from list of active modifiers. More...
 
override void OnEnable ()
 Adds this modifier to list of active modifiers. More...
 
- Protected Member Functions inherited from GraphModifier
override void Awake ()
 
virtual void OnDestroy ()
 
- Protected Member Functions inherited from VersionedMonoBehaviour
virtual int OnUpgradeSerializedData (int version, bool unityThread)
 Handle serialization backwards compatibility. More...
 

Static Protected Attributes

static Dictionary< GraphNode, NodeLink3reference = new Dictionary<GraphNode, NodeLink3>()
 
- Static Protected Attributes inherited from GraphModifier
static Dictionary< ulong, GraphModifierusedIDs = new Dictionary<ulong, GraphModifier>()
 Maps persistent IDs to the component that uses it. More...
 

Properties

GraphNode EndNode [get]
 
Transform EndTransform [get]
 
GraphNode StartNode [get]
 
Transform StartTransform [get]
 

Private Member Functions

void ContextApplyForce ()
 
void RemoveConnections (GraphNode node)
 

Private Attributes

Vector3 clamped1
 
Vector3 clamped2
 
MeshNode connectedNode1
 
MeshNode connectedNode2
 
NodeLink3Node endNode
 
bool postScanCalled = false
 
NodeLink3Node startNode
 

Static Private Attributes

static readonly Color GizmosColor = new Color(206.0f/255.0f, 136.0f/255.0f, 48.0f/255.0f, 0.5f)
 
static readonly Color GizmosColorSelected = new Color(235.0f/255.0f, 123.0f/255.0f, 32.0f/255.0f, 1.0f)
 

Additional Inherited Members

- Public Types inherited from GraphModifier
enum  EventType {
  PostScan = 1 << 0, PreScan = 1 << 1, LatePostScan = 1 << 2, PreUpdate = 1 << 3,
  PostUpdate = 1 << 4, PostCacheLoad = 1 << 5
}
 GraphModifier event type. More...
 
- Static Protected Member Functions inherited from GraphModifier
static List< T > GetModifiersOfType< T > ()
 
- Protected Attributes inherited from GraphModifier
ulong uniqueID
 Unique persistent ID for this component, used for serialization. More...
 

Member Function Documentation

◆ Apply()

void Apply ( bool  forceNewCheck)

◆ ContextApplyForce()

void ContextApplyForce ( )
private

◆ GetNodeLink()

static NodeLink3 GetNodeLink ( GraphNode  node)
static

◆ InternalOnPostScan()

void InternalOnPostScan ( )

◆ OnDisable()

override void OnDisable ( )
protectedvirtual

Removes this modifier from list of active modifiers.

Reimplemented from GraphModifier.

◆ OnDrawGizmos() [1/2]

void OnDrawGizmos ( )

◆ OnDrawGizmos() [2/2]

void OnDrawGizmos ( bool  selected)

◆ OnDrawGizmosSelected()

virtual void OnDrawGizmosSelected ( )
virtual

◆ OnEnable()

override void OnEnable ( )
protectedvirtual

Adds this modifier to list of active modifiers.

Reimplemented from GraphModifier.

◆ OnGraphsPostUpdate()

override void OnGraphsPostUpdate ( )
virtual

Called after graphs have been updated using GraphUpdateObjects.

Eventual flood filling has been done

Reimplemented from GraphModifier.

◆ OnPostScan()

override void OnPostScan ( )
virtual

Called right after all graphs have been scanned.

FloodFill and other post processing has not been done.

Warning
Since OnEnable and Awake are called roughly in the same time, the only way to ensure that these scripts get this call when scanning in Awake is to set the Script Execution Order for AstarPath to some time later than default time (see Edit -> Project Settings -> Script Execution Order).
Todo:
Is this still relevant? A call to FindAllModifiers should have before this method is called so the above warning is probably not relevant anymore.
See also
OnLatePostScan

Reimplemented from GraphModifier.

◆ RemoveConnections()

void RemoveConnections ( GraphNode  node)
private

Member Data Documentation

◆ clamped1

Vector3 clamped1
private

◆ clamped2

Vector3 clamped2
private

◆ connectedNode1

MeshNode connectedNode1
private

◆ connectedNode2

MeshNode connectedNode2
private

◆ costFactor

float costFactor = 1.0f

The connection will be this times harder/slower to traverse.

Note that values lower than one will not always make the pathfinder choose this path instead of another path even though this one should lead to a lower total cost unless you also adjust the Heuristic Scale in A* Inspector -> Settings -> Pathfinding or disable the heuristic altogether.

◆ end

Transform end

End position of the link.

◆ endNode

NodeLink3Node endNode
private

◆ GizmosColor

readonly Color GizmosColor = new Color(206.0f/255.0f, 136.0f/255.0f, 48.0f/255.0f, 0.5f)
staticprivate

◆ GizmosColorSelected

readonly Color GizmosColorSelected = new Color(235.0f/255.0f, 123.0f/255.0f, 32.0f/255.0f, 1.0f)
staticprivate

◆ oneWay

bool oneWay = false

Make a one-way connection.

◆ postScanCalled

bool postScanCalled = false
private

◆ reference

Dictionary<GraphNode, NodeLink3> reference = new Dictionary<GraphNode, NodeLink3>()
staticprotected

◆ startNode

NodeLink3Node startNode
private

Property Documentation

◆ EndNode

GraphNode EndNode
get

◆ EndTransform

Transform EndTransform
get

◆ StartNode

GraphNode StartNode
get

◆ StartTransform

Transform StartTransform
get

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