C# Class GoSpline, GoKit

Mostra file Open project: prime31/GoKit Class Usage Examples

Public Methods

Method Description
GoSpline ( List nodes, bool useStraightLines = false ) : System.Collections
GoSpline ( Vector3 nodes, bool useStraightLines = false ) : System.Collections
GoSpline ( string pathAssetName, bool useStraightLines = false ) : System.Collections
buildPath ( ) : void

responsible for calculating total length, segmentStartLocations and segmentDistances

bytesToVector3List ( byte bytes ) : List

helper to get a node list from an asset created with the visual editor

closePath ( ) : void

closes the path adding a new node at the end that is equal to the start node if it isn't already equal

drawGizmos ( Vector3 path, float resolution = 50 ) : void

helper for drawing gizmos in the editor

drawGizmos ( float resolution ) : void
getLastNode ( ) : Vector3

gets the last node. used to setup relative tweens

getPointOnPath ( float t ) : Vector3

returns the point that corresponds to the given t where t >= 0 and t <= 1 making sure that the path is traversed at a constant speed.

reverseNodes ( ) : void

reverses the order of the nodes

unreverseNodes ( ) : void

unreverses the order of the nodes if they were reversed

Private Methods

Method Description
getPoint ( float t ) : Vector3

directly gets the point for the current spline type with no lookup table to adjust for constant speed

nodeListFromAsset ( string pathAssetName ) : List

helper to get a node list from an asset created with the visual editor

Method Details

GoSpline() public method

public GoSpline ( List nodes, bool useStraightLines = false ) : System.Collections
nodes List
useStraightLines bool
return System.Collections

GoSpline() public method

public GoSpline ( Vector3 nodes, bool useStraightLines = false ) : System.Collections
nodes Vector3
useStraightLines bool
return System.Collections

GoSpline() public method

public GoSpline ( string pathAssetName, bool useStraightLines = false ) : System.Collections
pathAssetName string
useStraightLines bool
return System.Collections

buildPath() public method

responsible for calculating total length, segmentStartLocations and segmentDistances
public buildPath ( ) : void
return void

bytesToVector3List() public static method

helper to get a node list from an asset created with the visual editor
public static bytesToVector3List ( byte bytes ) : List
bytes byte
return List

closePath() public method

closes the path adding a new node at the end that is equal to the start node if it isn't already equal
public closePath ( ) : void
return void

drawGizmos() public static method

helper for drawing gizmos in the editor
public static drawGizmos ( Vector3 path, float resolution = 50 ) : void
path Vector3
resolution float
return void

drawGizmos() public method

public drawGizmos ( float resolution ) : void
resolution float
return void

getLastNode() public method

gets the last node. used to setup relative tweens
public getLastNode ( ) : Vector3
return Vector3

getPointOnPath() public method

returns the point that corresponds to the given t where t >= 0 and t <= 1 making sure that the path is traversed at a constant speed.
public getPointOnPath ( float t ) : Vector3
t float
return Vector3

reverseNodes() public method

reverses the order of the nodes
public reverseNodes ( ) : void
return void

unreverseNodes() public method

unreverses the order of the nodes if they were reversed
public unreverseNodes ( ) : void
return void