TopDown Engine  v3.6
MoreMountains.TopDownEngine.MovingPlatform2D Class Reference

A class to handle a platform that moves in 2D along a set of nodes More...

Inheritance diagram for MoreMountains.TopDownEngine.MovingPlatform2D:
MoreMountains.Tools.MMPathMovement

Public Attributes

bool UseSafeDistance = false
 whether or not to use Safe Distance mode, to force the character to move onto the platform More...
 
float ForcedSafeDistance = 1f
 the distance to move the character at in safe distance mode More...
 
- Public Attributes inherited from MoreMountains.Tools.MMPathMovement
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...
 
AlignmentModes AlignmentMode = AlignmentModes.None
 whether to align the path on nothing, this object's rotation, or this object's parent's rotation More...
 
float MovementSpeed = 1
 the movement speed More...
 
PossibleAccelerationType AccelerationType = PossibleAccelerationType.ConstantSpeed
 the movement type of the object More...
 
AnimationCurve Acceleration = new AnimationCurve(new Keyframe(0,1f),new Keyframe(1f,0f))
 the acceleration to apply to an object traveling between two points of the path. More...
 
UpdateModes UpdateMode = UpdateModes.Update
 the chosen update mode (update, fixed update, late update) More...
 
float MinDistanceToGoal = .1f
 the minimum distance to a point at which we'll arbitrarily decide the point's been reached More...
 

Protected Member Functions

virtual void AttachCharacterToMovingPlatform (Collider2D collider)
 
virtual void DetachCharacterFromPlatform (Collider2D collider)
 
virtual void OnTriggerEnter2D (Collider2D collider)
 When something collides, if it's a top down controller, we assign this platform to it More...
 
virtual void OnTriggerExit2D (Collider2D collider)
 When something stops colliding, if it's a top down controller, we unassign this platform to it More...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMPathMovement
virtual void Awake ()
 Initialization More...
 
virtual void Start ()
 On Start we store our initial position More...
 
virtual void Initialization ()
 Flag inits, initial movement determination, and object positioning More...
 
virtual void FixedUpdate ()
 
virtual void LateUpdate ()
 
virtual void Update ()
 
virtual void PointReached ()
 Override this to describe what happens when a point is reached More...
 
virtual void EndReached ()
 Override this to describe what happens when the end of the path is reached More...
 
virtual void ExecuteUpdate ()
 On update we keep moving along the path More...
 
virtual void Move ()
 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

TopDownController2D _topdDownController2D
 
Vector3 _translationVector
 
- Protected Attributes inherited from MoreMountains.Tools.MMPathMovement
Vector3 _originalTransformPosition
 the original position of the transform, hidden and shouldn't be accessed More...
 
bool _originalTransformPositionStatus = false
 
bool _active =false
 
IEnumerator< Vector3 > _currentPoint
 
int _direction = 1
 
Vector3 _initialPosition
 
Vector3 _finalPosition
 
Vector3 _previousPoint = Vector3.zero
 
float _waiting =0
 
int _currentIndex
 
float _distanceToNextPoint
 
bool _endReached = false
 
Vector3 _positionLastFrame
 
Vector3 _vector3Zero = Vector3.zero
 

Additional Inherited Members

- Public Types inherited from MoreMountains.Tools.MMPathMovement
enum  PossibleAccelerationType { PossibleAccelerationType.ConstantSpeed, PossibleAccelerationType.EaseOut, PossibleAccelerationType.AnimationCurve }
 the possible movement types More...
 
enum  CycleOptions {
  CycleOptions.BackAndForth, CycleOptions.Loop, CycleOptions.OnlyOnce, CycleOptions.StopAtBounds,
  CycleOptions.Random
}
 the possible cycle options More...
 
enum  MovementDirection { MovementDirection.Ascending, MovementDirection.Descending }
 the possible movement directions More...
 
enum  UpdateModes { UpdateModes.Update, UpdateModes.FixedUpdate, UpdateModes.LateUpdate }
 whether progress on the pass should be made at update, fixed update or late update More...
 
enum  AlignmentModes { AlignmentModes.None, AlignmentModes.ThisRotation, AlignmentModes.ParentRotation }
 whether to align the path on nothing, this object's rotation, or this object's parent's rotation More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMPathMovement
virtual void ResetPath ()
 A public method you can call to reset the path More...
 
virtual void MoveAlongThePath ()
 Moves the object along the path according to the specified movement type. More...
 
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 Vector3 PointPosition (int index)
 
virtual Vector3 PointPosition (Vector3 relativePointPosition)
 
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...
 
- Properties inherited from MoreMountains.Tools.MMPathMovement
virtual Vector3 CurrentSpeed [get, protected set]
 returns the current speed at which the object is traveling More...
 
virtual bool CanMove [get, set]
 if this is true, the object can move along the path More...
 

Detailed Description

A class to handle a platform that moves in 2D along a set of nodes

Member Function Documentation

◆ AttachCharacterToMovingPlatform()

virtual void MoreMountains.TopDownEngine.MovingPlatform2D.AttachCharacterToMovingPlatform ( Collider2D  collider)
protectedvirtual

◆ DetachCharacterFromPlatform()

virtual void MoreMountains.TopDownEngine.MovingPlatform2D.DetachCharacterFromPlatform ( Collider2D  collider)
protectedvirtual

◆ OnTriggerEnter2D()

virtual void MoreMountains.TopDownEngine.MovingPlatform2D.OnTriggerEnter2D ( Collider2D  collider)
protectedvirtual

When something collides, if it's a top down controller, we assign this platform to it

Parameters
collider

◆ OnTriggerExit2D()

virtual void MoreMountains.TopDownEngine.MovingPlatform2D.OnTriggerExit2D ( Collider2D  collider)
protectedvirtual

When something stops colliding, if it's a top down controller, we unassign this platform to it

Parameters
collider

Member Data Documentation

◆ _topdDownController2D

TopDownController2D MoreMountains.TopDownEngine.MovingPlatform2D._topdDownController2D
protected

◆ _translationVector

Vector3 MoreMountains.TopDownEngine.MovingPlatform2D._translationVector
protected

◆ ForcedSafeDistance

float MoreMountains.TopDownEngine.MovingPlatform2D.ForcedSafeDistance = 1f

the distance to move the character at in safe distance mode

◆ UseSafeDistance

bool MoreMountains.TopDownEngine.MovingPlatform2D.UseSafeDistance = false

whether or not to use Safe Distance mode, to force the character to move onto the platform


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