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

Like a normal enemy hazard but it can be enabled and disabled. More...

Inheritance diagram for PlatformerPro.EnemyHitBox:
PlatformerPro.EnemyHazard PlatformerPro.Hazard

Public Member Functions

virtual void Enable (float enableTime, float disableTime)
 Start the hit. More...
 
virtual void ForceStop ()
 Forces the attack to finish. More...
 

Public Attributes

Collider2D myCollider
 Reference to collider. More...
 
- Public Attributes inherited from PlatformerPro.Hazard
int damageAmount
 Amount of damage dealt by this object. More...
 
DamageType damageType
 What type of damage does this hazard cause? More...
 
bool oneShot
 Should the damage be caused once, or should it be sent every frame. More...
 
bool damageCharacters = true
 Does this hazard cause damage to characters? More...
 
bool damageEnemies
 Does this hazard also cause damage to enemies? More...
 

Protected Member Functions

override void DoHit (Collider2D other)
 Do the actual hit. More...
 
virtual IEnumerator DoEnable (float enableTime, float disableTime)
 Turn on the hit box. More...
 
- Protected Member Functions inherited from PlatformerPro.EnemyHazard
override void Init ()
 Initialise this instance. More...
 

Protected Attributes

float hitTimer
 The hit timer. More...
 
- Protected Attributes inherited from PlatformerPro.EnemyHazard
Enemy enemy
 
CharacterHurtBox deferredHit
 Store the hit ready for processing at end of frame (note wont hit multiple enemies). More...
 
- Protected Attributes inherited from PlatformerPro.Hazard
bool hasFired
 Has the damage happened (for one shot types). More...
 
DamageInfo damageInfo
 Cache the damage info to avoid allocation. More...
 

Detailed Description

Like a normal enemy hazard but it can be enabled and disabled.

Member Function Documentation

◆ DoEnable()

virtual IEnumerator PlatformerPro.EnemyHitBox.DoEnable ( float  enableTime,
float  disableTime 
)
protectedvirtual

Turn on the hit box.

.

Returns
The enable.
Parameters
enableTimeEnable time.
disableTimeDisable time.

◆ DoHit()

override void PlatformerPro.EnemyHitBox.DoHit ( Collider2D  other)
protectedvirtual

Do the actual hit.

Parameters
otherOther.

Reimplemented from PlatformerPro.EnemyHazard.

◆ Enable()

virtual void PlatformerPro.EnemyHitBox.Enable ( float  enableTime,
float  disableTime 
)
virtual

Start the hit.

◆ ForceStop()

virtual void PlatformerPro.EnemyHitBox.ForceStop ( )
virtual

Forces the attack to finish.

Member Data Documentation

◆ hitTimer

float PlatformerPro.EnemyHitBox.hitTimer
protected

The hit timer.

◆ myCollider

Collider2D PlatformerPro.EnemyHitBox.myCollider

Reference to collider.


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