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

An enemy movement thatapplies a force on damage or death. More...

Inheritance diagram for PlatformerPro.EnemyMovement_Damaged_Knockback:
PlatformerPro.EnemyDeathMovement PlatformerPro.ICompletableMovement PlatformerPro.EnemyMovement 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 ()
 Moves the enemy. More...
 
override void DoDamage (DamageInfo info)
 Do the damaged movement More...
 
override void DoDeath (DamageInfo info)
 Do the death movement 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 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

Vector2 forceMultiplier
 How much force to apply. More...
 
float drag
 Drag to apply in X. More...
 
bool fixedForceInX
 If true just apply force in direction of x, ignoring extent of x damage direction. More...
 
bool fixedForceInY
 If true just apply y force directly, ignoring y extent and direction form damage info. More...
 
bool cancelOnGrounded
 If true lose control when hitting the ground. More...
 
float destroyDelay
 On death the GameObject will be destroyed after this many seconds. More...
 

Protected Member Functions

void SetUpExplosionForce (DamageInfo info)
 
IEnumerator DestroyAfterDelay ()
 Wait a while then destroy the enemy. More...
 

Protected Attributes

Vector2 explosionForce
 The explosion force. More...
 
bool isDeath
 Track if this is a death movement More...
 
bool hasLeftGround
 Have we left the ground? 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...
 
- Properties inherited from PlatformerPro.EnemyDeathMovement
virtual DamageMovementType damageMovementType [get]
 What does this death movement respond to? More...
 
virtual bool ExtendInvulnerableTime [get]
 Allow damage movement to extend invulnerable time (e.g. if enemy is frozen). 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 thatapplies a force on damage or death.

Member Function Documentation

◆ DestroyAfterDelay()

IEnumerator PlatformerPro.EnemyMovement_Damaged_Knockback.DestroyAfterDelay ( )
protected

Wait a while then destroy the enemy.

◆ DoDamage()

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

Do the damaged movement

Reimplemented from PlatformerPro.EnemyMovement.

◆ DoDeath()

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

Do the death movement

Reimplemented from PlatformerPro.EnemyMovement.

◆ DoMove()

override bool PlatformerPro.EnemyMovement_Damaged_Knockback.DoMove ( )
virtual

Moves the enemy.

Reimplemented from PlatformerPro.EnemyMovement.

◆ Init()

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

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

Reimplemented from PlatformerPro.EnemyMovement.

◆ SetUpExplosionForce()

void PlatformerPro.EnemyMovement_Damaged_Knockback.SetUpExplosionForce ( DamageInfo  info)
protected

Member Data Documentation

◆ cancelOnGrounded

bool PlatformerPro.EnemyMovement_Damaged_Knockback.cancelOnGrounded

If true lose control when hitting the ground.

◆ destroyDelay

float PlatformerPro.EnemyMovement_Damaged_Knockback.destroyDelay

On death the GameObject will be destroyed after this many seconds.

◆ drag

float PlatformerPro.EnemyMovement_Damaged_Knockback.drag

Drag to apply in X.

◆ explosionForce

Vector2 PlatformerPro.EnemyMovement_Damaged_Knockback.explosionForce
protected

The explosion force.

◆ fixedForceInX

bool PlatformerPro.EnemyMovement_Damaged_Knockback.fixedForceInX

If true just apply force in direction of x, ignoring extent of x damage direction.

◆ fixedForceInY

bool PlatformerPro.EnemyMovement_Damaged_Knockback.fixedForceInY

If true just apply y force directly, ignoring y extent and direction form damage info.

◆ forceMultiplier

Vector2 PlatformerPro.EnemyMovement_Damaged_Knockback.forceMultiplier

How much force to apply.

◆ hasLeftGround

bool PlatformerPro.EnemyMovement_Damaged_Knockback.hasLeftGround
protected

Have we left the ground?

◆ isDeath

bool PlatformerPro.EnemyMovement_Damaged_Knockback.isDeath
protected

Track if this is a death movement

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.EnemyMovement_Damaged_Knockback.AnimationState
get

Gets the animation state that this movement wants to set.

◆ Info

new static MovementInfo PlatformerPro.EnemyMovement_Damaged_Knockback.Info
staticget

Static movement info used by the editor.


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