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

Enemy movement which hides the enemy and plays a deploy/undeploy animation. More...

Inheritance diagram for PlatformerPro.EnemyMovement_HideWithDeploy:
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 character. More...
 
override bool LosingControl ()
 Called when this movement is losing control. In this case we want to play the deploy animation to bring us back to ready state. 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

float deployTime = 0.5f
 The deploy time. More...
 
bool disableHurtBox
 Should we also remove hazards when hiding? More...
 
bool makeInvulnerable = true
 If true character will be invulnerable while hidng. More...
 
bool removeHazards
 Should we also remove hazards when hiding? More...
 
AnimationState defaultAnimationState = AnimationState.IDLE
 The animation state to play if no hiding or deploying is happening. More...
 
float delayForRenablingHazard = 0.0f
 How long to wait before enabling hazard collider. Its often useful to wait a moment after hiding before making the hazards cause damage, particualrly if there is no deploy time. More...
 

Protected Types

enum class  LocalState { DEPLOYED , DEPLOYING , HIDING , UNDEPLOYING }
 

Protected Member Functions

IEnumerator EnableHazardAfterDelay ()
 Delay the enabling of the hazard. More...
 

Protected Attributes

LocalState state = LocalState.DEPLOYED
 Track our internal state. More...
 
float deployTimer
 The deploy timer. More...
 
Collider2D hurtCollider
 The hurt box collider. More...
 
Collider2D hazardCollider
 The hazard collider. 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.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 which hides the enemy and plays a deploy/undeploy animation.

Member Enumeration Documentation

◆ LocalState

Enumerator
DEPLOYED 
DEPLOYING 
HIDING 
UNDEPLOYING 

Member Function Documentation

◆ DoMove()

override bool PlatformerPro.EnemyMovement_HideWithDeploy.DoMove ( )
virtual

Moves the character.

Reimplemented from PlatformerPro.EnemyMovement.

◆ EnableHazardAfterDelay()

IEnumerator PlatformerPro.EnemyMovement_HideWithDeploy.EnableHazardAfterDelay ( )
protected

Delay the enabling of the hazard.

◆ Init()

override EnemyMovement PlatformerPro.EnemyMovement_HideWithDeploy.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_HideWithDeploy.LosingControl ( )
virtual

Called when this movement is losing control. In this case we want to play the deploy animation to bring us back to ready state.

Returns
true

false

Reimplemented from PlatformerPro.EnemyMovement.

Member Data Documentation

◆ defaultAnimationState

AnimationState PlatformerPro.EnemyMovement_HideWithDeploy.defaultAnimationState = AnimationState.IDLE

The animation state to play if no hiding or deploying is happening.

◆ delayForRenablingHazard

float PlatformerPro.EnemyMovement_HideWithDeploy.delayForRenablingHazard = 0.0f

How long to wait before enabling hazard collider. Its often useful to wait a moment after hiding before making the hazards cause damage, particualrly if there is no deploy time.

◆ deployTime

float PlatformerPro.EnemyMovement_HideWithDeploy.deployTime = 0.5f

The deploy time.

◆ deployTimer

float PlatformerPro.EnemyMovement_HideWithDeploy.deployTimer
protected

The deploy timer.

◆ disableHurtBox

bool PlatformerPro.EnemyMovement_HideWithDeploy.disableHurtBox

Should we also remove hazards when hiding?

◆ hazardCollider

Collider2D PlatformerPro.EnemyMovement_HideWithDeploy.hazardCollider
protected

The hazard collider.

◆ hurtCollider

Collider2D PlatformerPro.EnemyMovement_HideWithDeploy.hurtCollider
protected

The hurt box collider.

◆ makeInvulnerable

bool PlatformerPro.EnemyMovement_HideWithDeploy.makeInvulnerable = true

If true character will be invulnerable while hidng.

◆ removeHazards

bool PlatformerPro.EnemyMovement_HideWithDeploy.removeHazards

Should we also remove hazards when hiding?

◆ state

LocalState PlatformerPro.EnemyMovement_HideWithDeploy.state = LocalState.DEPLOYED
protected

Track our internal state.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.EnemyMovement_HideWithDeploy.AnimationState
get

Gets the animation state that this movement wants to set.

◆ Info

new static MovementInfo PlatformerPro.EnemyMovement_HideWithDeploy.Info
staticget

Static movement info used by the editor.


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