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

Detailed Description

Script for a fire object, such a big fire, wall of fire, anything that's fire. If burnout enabled, the fire will despawn after burnoutTime has passed. If an entity collides with the fire, it will be set on fire and take fire damage.

Documentation updated 8/26/2024

Author
Stephen Nuttall
Todo
Replace damageNonPlayers and damagePlayer bools with one layer mask that allows for more choices in what is damaged.

Private Member Functions

void Start ()
 Play set on fire sound effect and start burnout timer (if those are enabled).
 
void OnTriggerEnter2D (Collider2D col)
 If an object entered this fire, set it on fire (unless damageNonPlayers or damagePlayer dictates otherwise).
 
IEnumerator BurnoutTimer ()
 Wait burnoutTime seconds, then destroy this fire.
 

Private Attributes

int damageCount = 6
 How many times damage should be dealt after being set on fire by this object.
 
float damageSpeed = 0.5f
 How quickly damage should be dealt after being set on fire by this object.
 
int damage = 5
 Damage being set on fire from this object will do (every damageSpeed seconds).
 
float burnoutTime = 10f
 Seconds until fire despawns (if enabled).
 
bool burnout = false
 If burnout enabled, the fire will despawn after burnoutTime has passed.
 
bool damageNonPlayers = true
 If true, entities that are not the player will be set on fire when stepping into this object.
 
bool damagePlayer = true
 If true, the player will be set on fire when stepping into this object.
 
EventReference spawnSFX
 Sound effect that plays when the object first spawns in.
 
bool playSFXOnSpawn = false
 Play a set-on-fire sound effect when spawned.
 

Member Function Documentation

◆ BurnoutTimer()

IEnumerator FireObject.BurnoutTimer ( )
private

Wait burnoutTime seconds, then destroy this fire.

◆ OnTriggerEnter2D()

void FireObject.OnTriggerEnter2D ( Collider2D col)
private

If an object entered this fire, set it on fire (unless damageNonPlayers or damagePlayer dictates otherwise).

Parameters
colRepresents the object that entered the fire.

◆ Start()

void FireObject.Start ( )
private

Play set on fire sound effect and start burnout timer (if those are enabled).

Member Data Documentation

◆ burnout

bool FireObject.burnout = false
private

If burnout enabled, the fire will despawn after burnoutTime has passed.

◆ burnoutTime

float FireObject.burnoutTime = 10f
private

Seconds until fire despawns (if enabled).

◆ damage

int FireObject.damage = 5
private

Damage being set on fire from this object will do (every damageSpeed seconds).

◆ damageCount

int FireObject.damageCount = 6
private

How many times damage should be dealt after being set on fire by this object.

◆ damageNonPlayers

bool FireObject.damageNonPlayers = true
private

If true, entities that are not the player will be set on fire when stepping into this object.

◆ damagePlayer

bool FireObject.damagePlayer = true
private

If true, the player will be set on fire when stepping into this object.

◆ damageSpeed

float FireObject.damageSpeed = 0.5f
private

How quickly damage should be dealt after being set on fire by this object.

◆ playSFXOnSpawn

bool FireObject.playSFXOnSpawn = false
private

Play a set-on-fire sound effect when spawned.

◆ spawnSFX

EventReference FireObject.spawnSFX
private

Sound effect that plays when the object first spawns in.


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