Adventure Creator  1.66.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.Paths Class Reference
Inheritance diagram for AC.Paths:

Public Member Functions

bool WillStopAtNextNode (int currentNode)
 Checks if the next node is the final one. More...
 
void RecalculateToCenter (Vector3 startPosition, float maxNodeDistance=-1f)
 
void BuildNavPath (Vector3[] pointData)
 Rebuilds the nodes List from an array of points. The first point on the new path will be the GameObject's current position. More...
 
int GetNextNode (int currentNode, int prevNode, bool playerControlled)
 Gets the next node along a path, given the current one. More...
 
float GetLengthToNode (int n)
 Gets the distance along the path from the origin to a particular node More...
 
float GetLengthBetweenNodes (int a, int b)
 Gets the distance along the path from one node to another More...
 
float GetTotalLength ()
 Gets the total length of the path More...
 

Public Attributes

List< Vector3 > nodes = new List<Vector3>()
 
List< NodeCommandnodeCommands = new List<NodeCommand>()
 
ActionListSource commandSource
 
AC_PathType pathType = AC_PathType.ForwardOnly
 
PathSpeed pathSpeed
 
bool teleportToStart
 
bool affectY
 
float nodePause
 

Properties

bool RelativeMode [get, set]
 
Vector3 LastFramePosition [get, set]
 

Detailed Description

Stores a series of "nodes", which act as waypoints for character movements. Nodes can either be generated in-game by pathfinding algorithms (see NavigationEngine), or by defining them in the Unity Editor. Characters can be made to move along a path in one direction only, back-and-forth, or choose nodes at random. ActionLists can also be set to run when a character reaches each node.

Member Function Documentation

◆ BuildNavPath()

void AC.Paths.BuildNavPath ( Vector3 []  pointData)

Rebuilds the nodes List from an array of points. The first point on the new path will be the GameObject's current position.

Parameters
pointDataAn array of position vectors that dictate the new path

◆ GetLengthBetweenNodes()

float AC.Paths.GetLengthBetweenNodes ( int  a,
int  b 
)

Gets the distance along the path from one node to another

Parameters
aThe node to start from
bThe node to reach
Returns
The distance along the path between nodes a and b.

◆ GetLengthToNode()

float AC.Paths.GetLengthToNode ( int  n)

Gets the distance along the path from the origin to a particular node

Parameters
nThe index number of the node to check the distance to
Returns
The distance along the path from the origin to node n

◆ GetNextNode()

int AC.Paths.GetNextNode ( int  currentNode,
int  prevNode,
bool  playerControlled 
)

Gets the next node along a path, given the current one.

Parameters
currentNodeThe index number of the current node
prevNodeThe index number of the previous node (used for determining the direction along which the path is being traversed)
playerControlledTrue if the Player prefab is moving along the path during gameplay
Returns
The index number of the next node

◆ GetTotalLength()

float AC.Paths.GetTotalLength ( )

Gets the total length of the path

Returns
The total length of the path

◆ WillStopAtNextNode()

bool AC.Paths.WillStopAtNextNode ( int  currentNode)

Checks if the next node is the final one.

Parameters
currentNodeThe index number of the current node (i.e. the node before the one being checked)
Returns
True if the next node is the final one

Member Data Documentation

◆ affectY

bool AC.Paths.affectY

If True, then characters will attempt to move vertically to reach nodes

◆ commandSource

ActionListSource AC.Paths.commandSource

The source of ActionList objects that are run when nodes are reached (InScene, AssetFile)

◆ nodeCommands

List<NodeCommand> AC.Paths.nodeCommands = new List<NodeCommand>()

A List of NodeCommand instances that dictate what ActionList is run when each node is reached

◆ nodePause

float AC.Paths.nodePause

The time, in seconds, that a character will wait at each node before continuing along the path

◆ nodes

List<Vector3> AC.Paths.nodes = new List<Vector3>()

A List of nodes (Vector3) that define the path

◆ pathSpeed

PathSpeed AC.Paths.pathSpeed

The speed at which characters will traverse a path (Walk, Run)

◆ pathType

AC_PathType AC.Paths.pathType = AC_PathType.ForwardOnly

The way in which characters move between each node (ForwardOnly, Loop, PingPong, IsRandom)

◆ teleportToStart

bool AC.Paths.teleportToStart

If True, then the character will teleport to the first node before traversing the path