C# Класс GoSpline, GoKit

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

GoSpline() публичный Метод

public GoSpline ( List nodes, bool useStraightLines = false ) : System.Collections
nodes List
useStraightLines bool
Результат System.Collections

GoSpline() публичный Метод

public GoSpline ( Vector3 nodes, bool useStraightLines = false ) : System.Collections
nodes Vector3
useStraightLines bool
Результат System.Collections

GoSpline() публичный Метод

public GoSpline ( string pathAssetName, bool useStraightLines = false ) : System.Collections
pathAssetName string
useStraightLines bool
Результат System.Collections

buildPath() публичный Метод

responsible for calculating total length, segmentStartLocations and segmentDistances
public buildPath ( ) : void
Результат void

bytesToVector3List() публичный статический Метод

helper to get a node list from an asset created with the visual editor
public static bytesToVector3List ( byte bytes ) : List
bytes byte
Результат List

closePath() публичный Метод

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
Результат void

drawGizmos() публичный статический Метод

helper for drawing gizmos in the editor
public static drawGizmos ( Vector3 path, float resolution = 50 ) : void
path Vector3
resolution float
Результат void

drawGizmos() публичный Метод

public drawGizmos ( float resolution ) : void
resolution float
Результат void

getLastNode() публичный Метод

gets the last node. used to setup relative tweens
public getLastNode ( ) : Vector3
Результат Vector3

getPointOnPath() публичный Метод

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
Результат Vector3

reverseNodes() публичный Метод

reverses the order of the nodes
public reverseNodes ( ) : void
Результат void

unreverseNodes() публичный Метод

unreverses the order of the nodes if they were reversed
public unreverseNodes ( ) : void
Результат void