Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.EnemyMovement_WaypointMover Class Reference

An enemy movement that moves through a set of waypoints. More...

Inheritance diagram for PlatformerPro.EnemyMovement_WaypointMover:
PlatformerPro.EnemyMovement PlatformerPro.ICompletableMovement PlatformerPro.PlatformerProMonoBehaviour

Public Member Functions

override EnemyMovement Init (Enemy enemy)
 Initialise this movement and return a reference to the ready to use movement. More...
 
override bool DoMove ()
 Does the movement. More...
 
override void GainingControl ()
 Called when this movement is gaining control. More...
 
override bool LosingControl ()
 Called when this movement is losing control. More...
 
virtual void MoveComplete (IMob target, Vector2 finalPosition)
 Callback for when move is done. More...
 
- Public Member Functions inherited from PlatformerPro.EnemyMovement
virtual void DoDamage (DamageInfo info)
 Do the damage movement More...
 
virtual void DoDeath (DamageInfo info)
 Do the death movement More...
 
virtual void SetDirection (Vector2 direction)
 Often a movement will need some kind of direction information such as where the cahracter is in relation to the enemy. Use this to set that information. Note there is no specific rule for what that information is, it could be anything. More...
 
virtual void HitCharacter (Character character, DamageInfo info)
 Called when the enemy hits the character. More...
 
virtual void SwitchDirection ()
 Called by the enemy to switch (x) direction of the movement. Note that not all movements need to support this, they may do nothing. More...
 
virtual bool CheckForEdge (int movementDirection)
 Uses the Enemies feet colliders to see if there is nothing below the enemy, and if so returns true. More...
 
- Public Member Functions inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual void Validate (PlatformerProMonoBehaviour myTarget)
 Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More...
 

Public Attributes

List< Vector2 > wayPoints
 The way points. More...
 
float moveSpeed
 Speed to move towards the next waypoint at. More...
 
bool loop
 Should we loop or stop we reach the last position? More...
 
float pauseTime = 0.0f
 How long the enemy pauses at each waypoint. More...
 
TweenMode tweenMode
 Any tweening to apply. More...
 
bool setFacingDirection
 Should weupdate facing direction based on travel direction. More...
 
AnimationState animationState = AnimationState.RUN
 The animation state to set while charging. More...
 
AnimationState pausedAnimationState = AnimationState.IDLE
 The animation state to set while charging. More...
 
WaypointMoveCompleteType sendMoveComplete
 When do we send the move complete event? More...
 

Protected Member Functions

virtual IEnumerator SnapAfterDelay (Vector2 targetPosition)
 Moves after a delay. More...
 

Protected Attributes

IMobPositionTweener tweener
 Tweener which handles any moves. More...
 
bool tweenStarted
 Has tween started? More...
 
int currentWayPoint
 Index of the current way point. More...
 
float pauseTimer
 Tracks how long we have been paused. More...
 
- Protected Attributes inherited from PlatformerPro.EnemyMovement
Enemy enemy
 Cached reference to the character. More...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
override int FacingDirection [get]
 Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. More...
 
- Properties inherited from PlatformerPro.EnemyMovement
virtual AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
virtual string OverrideState [get]
 Gets the animation override state that this movement wants to set. More...
 
virtual int FacingDirection [get]
 Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. More...
 
virtual bool ShouldSnapToGround [get]
 If we are grounded shoudl we snap to the ground. Helps us handle slopes. More...
 
static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
- Properties inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual string Header [get]
 Gets the header string used to describe the component. More...
 
virtual string DocLink [get]
 Gets a link to documentation site. More...
 
virtual string VideoLink [get]
 Gets a link to a youtube video. More...
 
virtual string Deprecated [get]
 If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More...
 

Detailed Description

An enemy movement that moves through a set of waypoints.

Member Function Documentation

◆ DoMove()

override bool PlatformerPro.EnemyMovement_WaypointMover.DoMove ( )
virtual

Does the movement.

Reimplemented from PlatformerPro.EnemyMovement.

◆ GainingControl()

override void PlatformerPro.EnemyMovement_WaypointMover.GainingControl ( )
virtual

Called when this movement is gaining control.

Reimplemented from PlatformerPro.EnemyMovement.

◆ Init()

override EnemyMovement PlatformerPro.EnemyMovement_WaypointMover.Init ( Enemy  enemy)
virtual

Initialise this movement and return a reference to the ready to use movement.

Reimplemented from PlatformerPro.EnemyMovement.

◆ LosingControl()

override bool PlatformerPro.EnemyMovement_WaypointMover.LosingControl ( )
virtual

Called when this movement is losing control.

Returns
true, if a final animation is being played and control should not revert false otherwise.

Reimplemented from PlatformerPro.EnemyMovement.

◆ MoveComplete()

virtual void PlatformerPro.EnemyMovement_WaypointMover.MoveComplete ( IMob  target,
Vector2  finalPosition 
)
virtual

Callback for when move is done.

◆ SnapAfterDelay()

virtual IEnumerator PlatformerPro.EnemyMovement_WaypointMover.SnapAfterDelay ( Vector2  targetPosition)
protectedvirtual

Moves after a delay.

Returns
The after delay.

Member Data Documentation

◆ animationState

AnimationState PlatformerPro.EnemyMovement_WaypointMover.animationState = AnimationState.RUN

The animation state to set while charging.

◆ currentWayPoint

int PlatformerPro.EnemyMovement_WaypointMover.currentWayPoint
protected

Index of the current way point.

◆ loop

bool PlatformerPro.EnemyMovement_WaypointMover.loop

Should we loop or stop we reach the last position?

◆ moveSpeed

float PlatformerPro.EnemyMovement_WaypointMover.moveSpeed

Speed to move towards the next waypoint at.

◆ pausedAnimationState

AnimationState PlatformerPro.EnemyMovement_WaypointMover.pausedAnimationState = AnimationState.IDLE

The animation state to set while charging.

◆ pauseTime

float PlatformerPro.EnemyMovement_WaypointMover.pauseTime = 0.0f

How long the enemy pauses at each waypoint.

◆ pauseTimer

float PlatformerPro.EnemyMovement_WaypointMover.pauseTimer
protected

Tracks how long we have been paused.

◆ sendMoveComplete

WaypointMoveCompleteType PlatformerPro.EnemyMovement_WaypointMover.sendMoveComplete

When do we send the move complete event?

◆ setFacingDirection

bool PlatformerPro.EnemyMovement_WaypointMover.setFacingDirection

Should weupdate facing direction based on travel direction.

◆ tweener

IMobPositionTweener PlatformerPro.EnemyMovement_WaypointMover.tweener
protected

Tweener which handles any moves.

◆ tweenMode

TweenMode PlatformerPro.EnemyMovement_WaypointMover.tweenMode

Any tweening to apply.

◆ tweenStarted

bool PlatformerPro.EnemyMovement_WaypointMover.tweenStarted
protected

Has tween started?

◆ wayPoints

List<Vector2> PlatformerPro.EnemyMovement_WaypointMover.wayPoints

The way points.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.EnemyMovement_WaypointMover.AnimationState
get

Gets the animation state that this movement wants to set.

◆ FacingDirection

override int PlatformerPro.EnemyMovement_WaypointMover.FacingDirection
get

Returns the direction the character is facing. 0 for none, 1 for right, -1 for left.

◆ Info

new static MovementInfo PlatformerPro.EnemyMovement_WaypointMover.Info
staticget

Static movement info used by the editor.


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