Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
EarthquakeZone Class Reference

Private Member Functions

void Awake ()
 Set the size of the area particles can spawn in, set how long they'll spawn for, and create the particle spawner.
 
void Update ()
 Every frame, check if it's time to attempt to damage an entity. If so, damage each entity in the objectsToDamage list. If destroyWhenDoneDamaging is enabled, check if the damageCounter has passed damageCount and if so, destroy this object.
 
void OnTriggerEnter2D (Collider2D col)
 When an object enters the earthquake zone, attempt to slow it down and add it's object health to the objecctsToDamage.
 
void OnTriggerExit2D (Collider2D col)
 When an object enters the earthquake zone, attempt to restore it's speed and remove it's object health from the objecctsToDamage.
 

Private Attributes

Transform particles
 Reference to the particles that will spawn every time the earthquake damage occurs.
 
int damageAmount = 10
 The amount of damage the earthquake deals.
 
int damageCount = 3
 How many time the earthquake zone will damage entities inside it.
 
float timeBetweenDamage = 1f
 The time between each attempt at damaging entities.
 
float entitySpeedModifier = 3f
 How much entities are slowed down when inside the earthquake zone.
 
float particleLingerTime = 1f
 The amount of time after the last damage attempt the particles should linger for.
 
bool destroyWhenDoneDamaging = true
 Destroys the earthquake zone when it does all damageCount attempts at damaging entities.
 
int damageCounter = 0
 How many attempts at damaging entities have passed.
 
float damageTimer = 0f
 How much time since the last attempt at damaging entities.
 
List< ObjectHealthobjectsToDamage = new()
 The list of object health components to apply damage to.
 

Member Function Documentation

◆ Awake()

void EarthquakeZone.Awake ( )
private

Set the size of the area particles can spawn in, set how long they'll spawn for, and create the particle spawner.

◆ OnTriggerEnter2D()

void EarthquakeZone.OnTriggerEnter2D ( Collider2D col)
private

When an object enters the earthquake zone, attempt to slow it down and add it's object health to the objecctsToDamage.

◆ OnTriggerExit2D()

void EarthquakeZone.OnTriggerExit2D ( Collider2D col)
private

When an object enters the earthquake zone, attempt to restore it's speed and remove it's object health from the objecctsToDamage.

◆ Update()

void EarthquakeZone.Update ( )
private

Every frame, check if it's time to attempt to damage an entity. If so, damage each entity in the objectsToDamage list. If destroyWhenDoneDamaging is enabled, check if the damageCounter has passed damageCount and if so, destroy this object.

Member Data Documentation

◆ damageAmount

int EarthquakeZone.damageAmount = 10
private

The amount of damage the earthquake deals.

◆ damageCount

int EarthquakeZone.damageCount = 3
private

How many time the earthquake zone will damage entities inside it.

◆ damageCounter

int EarthquakeZone.damageCounter = 0
private

How many attempts at damaging entities have passed.

◆ damageTimer

float EarthquakeZone.damageTimer = 0f
private

How much time since the last attempt at damaging entities.

◆ destroyWhenDoneDamaging

bool EarthquakeZone.destroyWhenDoneDamaging = true
private

Destroys the earthquake zone when it does all damageCount attempts at damaging entities.

◆ entitySpeedModifier

float EarthquakeZone.entitySpeedModifier = 3f
private

How much entities are slowed down when inside the earthquake zone.

◆ objectsToDamage

List<ObjectHealth> EarthquakeZone.objectsToDamage = new()
private

The list of object health components to apply damage to.

◆ particleLingerTime

float EarthquakeZone.particleLingerTime = 1f
private

The amount of time after the last damage attempt the particles should linger for.

◆ particles

Transform EarthquakeZone.particles
private

Reference to the particles that will spawn every time the earthquake damage occurs.

◆ timeBetweenDamage

float EarthquakeZone.timeBetweenDamage = 1f
private

The time between each attempt at damaging entities.


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