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

Detailed Description

This script is responsible for displaying the joke that Anubis is supposed to tell when the player dies (stored in the DataManager) in the speech bubble above Anubis' head.

Documentation updated 9/3/2024

Author
Stephen Nuttall

Public Attributes

TMP_Text textbox
 Reference to the textbox inside the speech bubble that needs to be modified.
 
string[] defaultJokes
 List of the default jokes Anubis can tell. These are told if there's no specialized joke given from the object that killed the player.
 
string[] fireDeathJokes
 List of the default jokes Anubis can tell specifically if the player burns to death. The object that set the player on fire does not know when the player succumbs to the fire damage, so the list needs to be kept here.
 

Private Member Functions

void Awake ()
 Wait 1/100th of a second before displaying the joke. This allows Awake() in the DataManager to run its course first, so the correct data is used.
 
IEnumerator Delay ()
 Waits 0.01 seconds, then updates the textbox.
 
void UpdateTextbox ()
 Gets the joke to display from the DataManager, and set the text in the speech bubble to match it. If the joke is [DEFAULT] or [FIRE], we need to choose a joke ourselves from the corresponding list.
 

Private Attributes

string deathMessage
 

Member Function Documentation

◆ Awake()

void AnubisJokeTextbox.Awake ( )
private

Wait 1/100th of a second before displaying the joke. This allows Awake() in the DataManager to run its course first, so the correct data is used.

◆ Delay()

IEnumerator AnubisJokeTextbox.Delay ( )
private

Waits 0.01 seconds, then updates the textbox.

◆ UpdateTextbox()

void AnubisJokeTextbox.UpdateTextbox ( )
private

Gets the joke to display from the DataManager, and set the text in the speech bubble to match it. If the joke is [DEFAULT] or [FIRE], we need to choose a joke ourselves from the corresponding list.

Member Data Documentation

◆ deathMessage

string AnubisJokeTextbox.deathMessage
private

◆ defaultJokes

string [] AnubisJokeTextbox.defaultJokes

List of the default jokes Anubis can tell. These are told if there's no specialized joke given from the object that killed the player.

◆ fireDeathJokes

string [] AnubisJokeTextbox.fireDeathJokes

List of the default jokes Anubis can tell specifically if the player burns to death. The object that set the player on fire does not know when the player succumbs to the fire damage, so the list needs to be kept here.

◆ textbox

TMP_Text AnubisJokeTextbox.textbox

Reference to the textbox inside the speech bubble that needs to be modified.


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