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

An enemy movement class which allows multiple movements to be combined by proxying off DoMove calls to the right movement based on the enemy state. More...

Inheritance diagram for PlatformerPro.EnemyMovement_Distributor:
PlatformerPro.EnemyMovement PlatformerPro.PlatformerProMonoBehaviour

Public Member Functions

override EnemyMovement Init (Enemy enemy)
 Initialise the movement with the given movement data. More...
 
override bool DoMove ()
 Moves the character. More...
 
override void DoDamage (DamageInfo info)
 Do the damage movement More...
 
override void DoDeath (DamageInfo info)
 Do the death movement More...
 
override void HitCharacter (Character character, DamageInfo info)
 Called when the enemy hits the character. More...
 
override 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...
 
- Public Member Functions inherited from PlatformerPro.EnemyMovement
virtual void GainingControl ()
 Called when this movement is gaining control. More...
 
virtual bool LosingControl ()
 Called when this movement is losing control. 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 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

EnemyStateToMovement[] statesToMovements
 The array associating states to movements. More...
 

Protected Attributes

EnemyMovement currentMovement
 The current movement. More...
 
EnemyMovement defaultMovement
 Cached reference to the enemies normal movement. More...
 
EnemyMovement[] uniqueMovements
 A list of movements from statesToMovements with each movement only appearing once. 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...
 
virtual EnemyMovement CurrentMovement [get]
 Gets the current movement. 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 class which allows multiple movements to be combined by proxying off DoMove calls to the right movement based on the enemy state.

Member Function Documentation

◆ DoDamage()

override void PlatformerPro.EnemyMovement_Distributor.DoDamage ( DamageInfo  info)
virtual

Do the damage movement

Reimplemented from PlatformerPro.EnemyMovement.

◆ DoDeath()

override void PlatformerPro.EnemyMovement_Distributor.DoDeath ( DamageInfo  info)
virtual

Do the death movement

Reimplemented from PlatformerPro.EnemyMovement.

◆ DoMove()

override bool PlatformerPro.EnemyMovement_Distributor.DoMove ( )
virtual

Moves the character.

Reimplemented from PlatformerPro.EnemyMovement.

◆ HitCharacter()

override void PlatformerPro.EnemyMovement_Distributor.HitCharacter ( Character  character,
DamageInfo  info 
)
virtual

Called when the enemy hits the character.

Parameters
characterCharacter.
infoDamage info.

Reimplemented from PlatformerPro.EnemyMovement.

◆ Init()

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

Initialise the movement with the given movement data.

Parameters
enemyThe enemy.
movementDataMovement data.

Reimplemented from PlatformerPro.EnemyMovement.

◆ SwitchDirection()

override void PlatformerPro.EnemyMovement_Distributor.SwitchDirection ( )
virtual

Called by the enemy to switch (x) direction of the movement. Note that not all movements need to support this, they may do nothing.

Reimplemented from PlatformerPro.EnemyMovement.

Member Data Documentation

◆ currentMovement

EnemyMovement PlatformerPro.EnemyMovement_Distributor.currentMovement
protected

The current movement.

◆ defaultMovement

EnemyMovement PlatformerPro.EnemyMovement_Distributor.defaultMovement
protected

Cached reference to the enemies normal movement.

◆ statesToMovements

EnemyStateToMovement [] PlatformerPro.EnemyMovement_Distributor.statesToMovements

The array associating states to movements.

◆ uniqueMovements

EnemyMovement [] PlatformerPro.EnemyMovement_Distributor.uniqueMovements
protected

A list of movements from statesToMovements with each movement only appearing once.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.EnemyMovement_Distributor.AnimationState
get

Gets the animation state that this movement wants to set.

◆ CurrentMovement

virtual EnemyMovement PlatformerPro.EnemyMovement_Distributor.CurrentMovement
get

Gets the current movement.

The current movement.

◆ FacingDirection

override int PlatformerPro.EnemyMovement_Distributor.FacingDirection
get

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

◆ Info

new static MovementInfo PlatformerPro.EnemyMovement_Distributor.Info
staticget

Static movement info used by the editor.


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