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

Enemy movement for simple melee attack. More...

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

Public Member Functions

override EnemyMovement Init (Enemy enemy)
 Init this instance. More...
 
virtual void Attack ()
 Do whichever attack is available. More...
 
override bool DoMove ()
 Moves the character. More...
 
override bool LosingControl ()
 Called when this movement is losing control. 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 GainingControl ()
 Called when this movement is gaining 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

BasicAttackData attack
 The attack data. More...
 
EnemyHitBox hitBox
 The hazard / hit box. More...
 
float coolDown
 Time between attacks More...
 
bool faceEnemyOnAttack
 Should we face an enemy when we attack? More...
 

Protected Member Functions

virtual IEnumerator DoAttack ()
 Does the attack. More...
 

Protected Attributes

float currentAttackTimer
 The timer for the current attack. More...
 
bool attacking
 Are we in the middle of an attack? More...
 
bool startedAttacking
 Has attack started? More...
 
int facingDirection
 The facing direction. 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]
 
- 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

Enemy movement for simple melee attack.

Member Function Documentation

◆ Attack()

virtual void PlatformerPro.EnemyMovement_MeleeAttack.Attack ( )
virtual

Do whichever attack is available.

◆ DoAttack()

virtual IEnumerator PlatformerPro.EnemyMovement_MeleeAttack.DoAttack ( )
protectedvirtual

Does the attack.

Returns
The attack.
Parameters
attackIndexAttack index.

◆ DoMove()

override bool PlatformerPro.EnemyMovement_MeleeAttack.DoMove ( )
virtual

Moves the character.

Reimplemented from PlatformerPro.EnemyMovement.

◆ Init()

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

Init this instance.

Reimplemented from PlatformerPro.EnemyMovement.

◆ LosingControl()

override bool PlatformerPro.EnemyMovement_MeleeAttack.LosingControl ( )
virtual

Called when this movement is losing control.

Returns
true if we are still attacking as we don't want to break a melee attack mid movement

false

Reimplemented from PlatformerPro.EnemyMovement.

Member Data Documentation

◆ attack

BasicAttackData PlatformerPro.EnemyMovement_MeleeAttack.attack

The attack data.

◆ attacking

bool PlatformerPro.EnemyMovement_MeleeAttack.attacking
protected

Are we in the middle of an attack?

◆ coolDown

float PlatformerPro.EnemyMovement_MeleeAttack.coolDown

Time between attacks

◆ currentAttackTimer

float PlatformerPro.EnemyMovement_MeleeAttack.currentAttackTimer
protected

The timer for the current attack.

◆ faceEnemyOnAttack

bool PlatformerPro.EnemyMovement_MeleeAttack.faceEnemyOnAttack

Should we face an enemy when we attack?

◆ facingDirection

int PlatformerPro.EnemyMovement_MeleeAttack.facingDirection
protected

The facing direction.

◆ hitBox

EnemyHitBox PlatformerPro.EnemyMovement_MeleeAttack.hitBox

The hazard / hit box.

◆ startedAttacking

bool PlatformerPro.EnemyMovement_MeleeAttack.startedAttacking
protected

Has attack started?

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.EnemyMovement_MeleeAttack.AnimationState
get

Gets the animation state that this movement wants to set.

The state of the animation.

◆ FacingDirection

override int PlatformerPro.EnemyMovement_MeleeAttack.FacingDirection
get

◆ Info

new static MovementInfo PlatformerPro.EnemyMovement_MeleeAttack.Info
staticget

Static movement info used by the editor.


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