Simple Waypoint System  5.5
Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
WaypointManager

The editor part of this class allows you to create paths in 2D or 3D space. At runtime, it manages path instances for easy lookup of references. More...

Inheritance diagram for WaypointManager:

Static Public Member Functions

static void AddPath (GameObject path)
 Adds the gameobject to the path dictionary, if it contains a path component. More...
 
static void CleanUp ()
 Clears destroyed path gameobjects from the Paths dictionary. More...
 
static void DrawStraight (Vector3[] waypoints)
 Draws straight gizmo lines between waypoints. More...
 
static void DrawCurved (Vector3[] pathPoints)
 Draws curved gizmo lines between waypoints, taken and modified from HOTween. More...
 
static Vector3[] GetCurved (Vector3[] waypoints)
 
static Vector3 GetPoint (Vector3[] gizmoPoints, float t)
 Gets the point on the curve at a given percentage (0-1). Taken and modified from HOTween. More...
 
static float GetPathLength (Vector3[] waypoints)
 Calculates the total path length. More...
 
static List< Vector3 > SmoothCurve (List< Vector3 > pathToCurve, int interpolations)
 Smoothes a list of Vector3's based on the number of interpolations. Credits to "Codetastic". More...
 

Public Attributes

KeyCode placementKey = KeyCode.P
 Key for placing new waypoints in the scene More...
 
KeyCode viewPlacementKey = KeyCode.C
 Key for placing new waypoints at the current scene view camera position More...
 

Static Public Attributes

static readonly Dictionary< string, PathManagerPaths = new Dictionary<string, PathManager>()
 Stores all path components in the scene along with their name. You can access them by calling WaypointManager.Paths["path name"]. More...
 

Detailed Description

The editor part of this class allows you to create paths in 2D or 3D space. At runtime, it manages path instances for easy lookup of references.

Member Function Documentation

static void AddPath ( GameObject  path)
static

Adds the gameobject to the path dictionary, if it contains a path component.

static void CleanUp ( )
static

Clears destroyed path gameobjects from the Paths dictionary.

static void DrawCurved ( Vector3[]  pathPoints)
static

Draws curved gizmo lines between waypoints, taken and modified from HOTween.

static void DrawStraight ( Vector3[]  waypoints)
static

Draws straight gizmo lines between waypoints.

static Vector3 [] GetCurved ( Vector3[]  waypoints)
static
static float GetPathLength ( Vector3[]  waypoints)
static

Calculates the total path length.

static Vector3 GetPoint ( Vector3[]  gizmoPoints,
float  t 
)
static

Gets the point on the curve at a given percentage (0-1). Taken and modified from HOTween.

static List<Vector3> SmoothCurve ( List< Vector3 >  pathToCurve,
int  interpolations 
)
static

Smoothes a list of Vector3's based on the number of interpolations. Credits to "Codetastic".

Member Data Documentation

readonly Dictionary<string, PathManager> Paths = new Dictionary<string, PathManager>()
static

Stores all path components in the scene along with their name. You can access them by calling WaypointManager.Paths["path name"].

KeyCode placementKey = KeyCode.P

Key for placing new waypoints in the scene

KeyCode viewPlacementKey = KeyCode.C

Key for placing new waypoints at the current scene view camera position


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