Inventory Engine v4.2
Loading...
Searching...
No Matches
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...

Inherits MonoBehaviour.

Classes

struct  Data
 A data structure. More...

Public Types

enum  CycleOptions { BackAndForth , Loop , OnlyOnce }
 the possible cycle options More...
enum  MovementDirection { Ascending , Descending }
 the possible movement directions More...

Public Member Functions

virtual void Initialization ()
 Flag inits, initial movement determination, and object positioning.
int CurrentIndex ()
Vector3 CurrentPoint ()
Vector3 CurrentPositionRelative ()
virtual IEnumerator< Vector3 > GetPathEnumerator ()
 Returns the current target point in the path.
virtual void ChangeDirection ()
 Call this method to force a change in direction at any time.
virtual void UpdateOriginalTransformPosition (Vector3 newOriginalTransformPosition)
 Updates the original transform position.
virtual Vector3 GetOriginalTransformPosition ()
 Gets the original transform position.
virtual void SetOriginalTransformPositionStatus (bool status)
 Sets the original transform position status.
virtual bool GetOriginalTransformPositionStatus ()
 Gets the original transform position status.
void SetPath (in Data configuration)
 Replaces this MMPath's settings with the ones passed in parameters.

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
List< MMPathMovementElementPathElements
 the points that make up the path the object will follow
MMPath ReferenceMMPath
 another MMPath that you can reference. If set, the reference MMPath's data will replace this MMPath's
bool AbsoluteReferencePath = false
 if this is true, this object will move to the 0 position of the reference path
float MinDistanceToGoal = .1f
 the minimum distance to a point at which we'll arbitrarily decide the point's been reached
bool LockHandlesOnXAxis = false
bool LockHandlesOnYAxis = false
bool LockHandlesOnZAxis = false

Protected Member Functions

virtual void Start ()
 Initialization.
virtual void Update ()
 On update we keep moving along the path.
virtual void ComputePath ()
 Moves the object and determines when a point has been reached.
virtual void OnDrawGizmos ()
 On DrawGizmos, we draw lines to show the path the object will follow.

Protected Attributes

Vector3 _originalTransformPosition
 the original position of the transform, hidden and shouldn't be accessed
bool _originalTransformPositionStatus =false
 internal flag, hidden and shouldn't be accessed
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

bool EndReached [get]
 if this is true, the path has reached its end
virtual bool CanMove [get, set]
 if this is true, the object can move along the path
virtual bool Initialized [get, set]
 if this is true, this path has gone through its Initialization method
virtual int Direction [get]

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

◆ 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

◆ Direction

virtual int MoreMountains.Tools.MMPath.Direction
get

◆ EndReached

bool MoreMountains.Tools.MMPath.EndReached
get

if this is true, the path has reached its end

◆ 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: