A* Pathfinding Project  4.2.2
The A* Pathfinding Project for Unity 3D
SingleNodeBlocker Class Reference

Blocks single nodes in a graph. More...

Detailed Description

Blocks single nodes in a graph.

This is useful in turn based games where you want units to avoid all other units while pathfinding but not be blocked by itself.

Note
This cannot be used together with any movement script as the nodes are not blocked in the normal way.
See also
TurnBasedAI for example usage
BlockManager
Utilities for turn-based games

Public Member Functions

void Block (GraphNode node)
 Block specified node. More...
 
void BlockAt (Vector3 position)
 Block node closest to the specified position. More...
 
void BlockAtCurrentPosition ()
 Block node closest to the position of this object. More...
 
void Unblock ()
 Unblock the last node that was blocked (if any) More...
 

Public Attributes

BlockManager manager
 

Properties

GraphNode lastBlocked [get, private set]
 

Additional Inherited Members

- Protected Member Functions inherited from VersionedMonoBehaviour
virtual void Awake ()
 
virtual int OnUpgradeSerializedData (int version, bool unityThread)
 Handle serialization backwards compatibility. More...
 
virtual void Reset ()
 Handle serialization backwards compatibility. More...
 

Member Function Documentation

◆ Block()

void Block ( GraphNode  node)

Block specified node.

Will unblock the last node that was reserved (if any)

◆ BlockAt()

void BlockAt ( Vector3  position)

Block node closest to the specified position.

Will unblock the last node that was reserved (if any)

◆ BlockAtCurrentPosition()

void BlockAtCurrentPosition ( )

Block node closest to the position of this object.

Will unblock the last node that was reserved (if any)

◆ Unblock()

void Unblock ( )

Unblock the last node that was blocked (if any)

Member Data Documentation

◆ manager

BlockManager manager

Property Documentation

◆ lastBlocked

GraphNode lastBlocked
getprivate set

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