Feel  3.16
The best way to improve your game's feel and make it extra juicy
MoreMountains.Tools.MMPath Class Reference

Add this component to an object and you'll be able to define a path, that can then be used by another component More...

Inheritance diagram for MoreMountains.Tools.MMPath:

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< MMPathMovementElementPathElements
 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 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...
 

Detailed Description

Add this component to an object and you'll be able to define a path, that can then be used by another component

Member Enumeration Documentation

◆ CycleOptions

the possible cycle options

Enumerator
BackAndForth 
Loop 
OnlyOnce 

◆ MovementDirection

the possible movement directions

Enumerator
Ascending 
Descending 

Member Function Documentation

◆ ChangeDirection()

virtual void MoreMountains.Tools.MMPath.ChangeDirection ( )
virtual

Call this method to force a change in direction at any time

◆ ComputePath()

virtual void MoreMountains.Tools.MMPath.ComputePath ( )
protectedvirtual

Moves the object and determines when a point has been reached

◆ CurrentIndex()

int MoreMountains.Tools.MMPath.CurrentIndex ( )

◆ CurrentPoint()

Vector3 MoreMountains.Tools.MMPath.CurrentPoint ( )

◆ CurrentPositionRelative()

Vector3 MoreMountains.Tools.MMPath.CurrentPositionRelative ( )

◆ GetOriginalTransformPosition()

virtual Vector3 MoreMountains.Tools.MMPath.GetOriginalTransformPosition ( )
virtual

Gets the original transform position.

Returns
The original transform position.

◆ GetOriginalTransformPositionStatus()

virtual bool MoreMountains.Tools.MMPath.GetOriginalTransformPositionStatus ( )
virtual

Gets the original transform position status.

Returns
true, if original transform position status was gotten, false otherwise.

◆ GetPathEnumerator()

virtual IEnumerator<Vector3> MoreMountains.Tools.MMPath.GetPathEnumerator ( )
virtual

Returns the current target point in the path

Returns
The path enumerator.

◆ Initialization()

virtual void MoreMountains.Tools.MMPath.Initialization ( )
virtual

Flag inits, initial movement determination, and object positioning

◆ OnDrawGizmos()

virtual void MoreMountains.Tools.MMPath.OnDrawGizmos ( )
protectedvirtual

On DrawGizmos, we draw lines to show the path the object will follow

◆ SetOriginalTransformPositionStatus()

virtual void MoreMountains.Tools.MMPath.SetOriginalTransformPositionStatus ( bool  status)
virtual

Sets the original transform position status.

Parameters
statusIf set to true status.

◆ SetPath()

void MoreMountains.Tools.MMPath.SetPath ( in Data  configuration)

Replaces this MMPath's settings with the ones passed in parameters

Parameters
configuration

◆ Start()

virtual void MoreMountains.Tools.MMPath.Start ( )
protectedvirtual

Initialization

◆ Update()

virtual void MoreMountains.Tools.MMPath.Update ( )
protectedvirtual

On update we keep moving along the path

◆ UpdateOriginalTransformPosition()

virtual void MoreMountains.Tools.MMPath.UpdateOriginalTransformPosition ( Vector3  newOriginalTransformPosition)
virtual

Updates the original transform position.

Parameters
newOriginalTransformPositionNew original transform position.

Member Data Documentation

◆ _active

bool MoreMountains.Tools.MMPath._active =false
protected

◆ _currentIndex

int MoreMountains.Tools.MMPath._currentIndex
protected

◆ _currentPoint

IEnumerator<Vector3> MoreMountains.Tools.MMPath._currentPoint
protected

◆ _direction

int MoreMountains.Tools.MMPath._direction = 1
protected

◆ _distanceToNextPoint

float MoreMountains.Tools.MMPath._distanceToNextPoint
protected

◆ _endReached

bool MoreMountains.Tools.MMPath._endReached = false
protected

◆ _finalPosition

Vector3 MoreMountains.Tools.MMPath._finalPosition
protected

◆ _initialPosition

Vector3 MoreMountains.Tools.MMPath._initialPosition
protected

◆ _initialPositionThisFrame

Vector3 MoreMountains.Tools.MMPath._initialPositionThisFrame
protected

◆ _originalTransformPosition

Vector3 MoreMountains.Tools.MMPath._originalTransformPosition
protected

the original position of the transform, hidden and shouldn't be accessed

◆ _originalTransformPositionStatus

bool MoreMountains.Tools.MMPath._originalTransformPositionStatus =false
protected

internal flag, hidden and shouldn't be accessed

◆ _previousPoint

Vector3 MoreMountains.Tools.MMPath._previousPoint = Vector3.zero
protected

◆ AbsoluteReferencePath

bool MoreMountains.Tools.MMPath.AbsoluteReferencePath = false

if this is true, this object will move to the 0 position of the reference path

◆ CycleOption

CycleOptions MoreMountains.Tools.MMPath.CycleOption

◆ Direction

virtual int MoreMountains.Tools.MMPath.Direction => _direction

◆ LockHandlesOnXAxis

bool MoreMountains.Tools.MMPath.LockHandlesOnXAxis = false

◆ LockHandlesOnYAxis

bool MoreMountains.Tools.MMPath.LockHandlesOnYAxis = false

◆ LockHandlesOnZAxis

bool MoreMountains.Tools.MMPath.LockHandlesOnZAxis = false

◆ LoopInitialMovementDirection

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

◆ MinDistanceToGoal

float MoreMountains.Tools.MMPath.MinDistanceToGoal = .1f

the minimum distance to a point at which we'll arbitrarily decide the point's been reached

◆ PathElements

List<MMPathMovementElement> MoreMountains.Tools.MMPath.PathElements

the points that make up the path the object will follow

◆ ReferenceMMPath

MMPath MoreMountains.Tools.MMPath.ReferenceMMPath

another MMPath that you can reference. If set, the reference MMPath's data will replace this MMPath's

Property Documentation

◆ CanMove

virtual bool MoreMountains.Tools.MMPath.CanMove
getset

if this is true, the object can move along the path

◆ Initialized

virtual bool MoreMountains.Tools.MMPath.Initialized
getset

if this is true, this path has gone through its Initialization method


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