Corgi Engine
v9.2
|
Add this component to an object and you'll be able to define a path, that can then be used by another component More...
Classes | |
struct | Data |
A data structure More... | |
Public Types | |
enum | CycleOptions { CycleOptions.BackAndForth, CycleOptions.Loop, CycleOptions.OnlyOnce } |
the possible cycle options More... | |
enum | MovementDirection { MovementDirection.Ascending, MovementDirection.Descending } |
the possible movement directions More... | |
Public Member Functions | |
virtual void | Initialization () |
Flag inits, initial movement determination, and object positioning More... | |
int | CurrentIndex () |
Vector3 | CurrentPoint () |
Vector3 | CurrentPositionRelative () |
virtual IEnumerator< Vector3 > | GetPathEnumerator () |
Returns the current target point in the path More... | |
virtual void | ChangeDirection () |
Call this method to force a change in direction at any time More... | |
virtual void | UpdateOriginalTransformPosition (Vector3 newOriginalTransformPosition) |
Updates the original transform position. More... | |
virtual Vector3 | GetOriginalTransformPosition () |
Gets the original transform position. More... | |
virtual void | SetOriginalTransformPositionStatus (bool status) |
Sets the original transform position status. More... | |
virtual bool | GetOriginalTransformPositionStatus () |
Gets the original transform position status. More... | |
void | SetPath (in Data configuration) |
Replaces this MMPath's settings with the ones passed in parameters More... | |
Public Attributes | |
CycleOptions | CycleOption |
MovementDirection | LoopInitialMovementDirection = MovementDirection.Ascending |
the initial movement direction : ascending > will go from the points 0 to 1, 2, etc ; descending > will go from the last point to last-1, last-2, etc More... | |
List< MMPathMovementElement > | PathElements |
the points that make up the path the object will follow More... | |
MMPath | ReferenceMMPath |
another MMPath that you can reference. If set, the reference MMPath's data will replace this MMPath's More... | |
bool | AbsoluteReferencePath = false |
if this is true, this object will move to the 0 position of the reference path More... | |
float | MinDistanceToGoal = .1f |
the minimum distance to a point at which we'll arbitrarily decide the point's been reached More... | |
bool | EndReached => _endReached |
if this is true, the path has reached its end More... | |
bool | LockHandlesOnXAxis = false |
bool | LockHandlesOnYAxis = false |
bool | LockHandlesOnZAxis = false |
virtual int | Direction => _direction |
Protected Member Functions | |
virtual void | Start () |
Initialization More... | |
virtual void | Update () |
On update we keep moving along the path More... | |
virtual void | ComputePath () |
Moves the object and determines when a point has been reached More... | |
virtual void | OnDrawGizmos () |
On DrawGizmos, we draw lines to show the path the object will follow More... | |
Protected Attributes | |
Vector3 | _originalTransformPosition |
the original position of the transform, hidden and shouldn't be accessed More... | |
bool | _originalTransformPositionStatus =false |
internal flag, hidden and shouldn't be accessed More... | |
bool | _active =false |
IEnumerator< Vector3 > | _currentPoint |
int | _direction = 1 |
Vector3 | _initialPosition |
Vector3 | _initialPositionThisFrame |
Vector3 | _finalPosition |
Vector3 | _previousPoint = Vector3.zero |
int | _currentIndex |
float | _distanceToNextPoint |
bool | _endReached = false |
Properties | |
virtual bool | CanMove [get, set] |
if this is true, the object can move along the path More... | |
virtual bool | Initialized [get, set] |
if this is true, this path has gone through its Initialization method More... | |
Add this component to an object and you'll be able to define a path, that can then be used by another component
|
strong |
|
strong |
|
virtual |
Call this method to force a change in direction at any time
|
protectedvirtual |
Moves the object and determines when a point has been reached
int MoreMountains.Tools.MMPath.CurrentIndex | ( | ) |
Vector3 MoreMountains.Tools.MMPath.CurrentPoint | ( | ) |
Vector3 MoreMountains.Tools.MMPath.CurrentPositionRelative | ( | ) |
|
virtual |
Gets the original transform position.
|
virtual |
Gets the original transform position status.
true
, if original transform position status was gotten, false
otherwise.
|
virtual |
Returns the current target point in the path
|
virtual |
Flag inits, initial movement determination, and object positioning
|
protectedvirtual |
On DrawGizmos, we draw lines to show the path the object will follow
|
virtual |
Sets the original transform position status.
status | If set to true status. |
void MoreMountains.Tools.MMPath.SetPath | ( | in Data | configuration | ) |
Replaces this MMPath's settings with the ones passed in parameters
configuration |
|
protectedvirtual |
Initialization
|
protectedvirtual |
On update we keep moving along the path
|
virtual |
Updates the original transform position.
newOriginalTransformPosition | New original transform position. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
the original position of the transform, hidden and shouldn't be accessed
|
protected |
internal flag, hidden and shouldn't be accessed
|
protected |
bool MoreMountains.Tools.MMPath.AbsoluteReferencePath = false |
if this is true, this object will move to the 0 position of the reference path
CycleOptions MoreMountains.Tools.MMPath.CycleOption |
virtual int MoreMountains.Tools.MMPath.Direction => _direction |
bool MoreMountains.Tools.MMPath.EndReached => _endReached |
if this is true, the path has reached its end
bool MoreMountains.Tools.MMPath.LockHandlesOnXAxis = false |
bool MoreMountains.Tools.MMPath.LockHandlesOnYAxis = false |
bool MoreMountains.Tools.MMPath.LockHandlesOnZAxis = false |
MovementDirection MoreMountains.Tools.MMPath.LoopInitialMovementDirection = MovementDirection.Ascending |
the initial movement direction : ascending > will go from the points 0 to 1, 2, etc ; descending > will go from the last point to last-1, last-2, etc
float MoreMountains.Tools.MMPath.MinDistanceToGoal = .1f |
the minimum distance to a point at which we'll arbitrarily decide the point's been reached
List<MMPathMovementElement> MoreMountains.Tools.MMPath.PathElements |
the points that make up the path the object will follow
MMPath MoreMountains.Tools.MMPath.ReferenceMMPath |
|
getset |
if this is true, the object can move along the path
|
getset |
if this is true, this path has gone through its Initialization method