![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
Remembers the amount of health potions the player has, and uses the potions when potionHotkey is pressed.
Documentation updated 3/5/2024
Events | |
static Action< int > | potionCountChanged |
Triggers when the amount of potions changes. | |
static Action< int > | potionUsed |
Triggers when a potion is used. | |
Private Member Functions | |
void | Awake () |
On Awake, get the potion count from the DataManager. | |
void | OnEnable () |
Subscribes to the PotionPickedUp event. | |
void | OnDisable () |
Unsubscribes from the PotionPickedUp event. | |
void | AddPotion () |
Adds a potion unless the player currently has the maximum amount. | |
void | Update () |
Every frame, use a potion if the user can and wants to. | |
IEnumerator | Cooldown () |
Set onCooldown to true, wait cooldownLength, then set onCooldown to false. | |
Private Attributes | |
KeyCode | potionHotkey |
The hot key for using a potion. | |
int | potionHealAmount = 20 |
The amount a potion should heal. | |
int | maxPotionCount = 6 |
The maximum amount of potions the player can have. | |
float | cooldownLength = 3f |
The length of the cooldown after using a potion. | |
int | potionCount = 0 |
The amount of potions the player currently has. | |
bool | onCooldown = false |
Whether or not using the potion is on cooldown. | |
|
private |
Adds a potion unless the player currently has the maximum amount.
|
private |
On Awake, get the potion count from the DataManager.
|
private |
Set onCooldown to true, wait cooldownLength, then set onCooldown to false.
|
private |
Unsubscribes from the PotionPickedUp event.
|
private |
Subscribes to the PotionPickedUp event.
|
private |
Every frame, use a potion if the user can and wants to.
|
private |
The length of the cooldown after using a potion.
|
private |
The maximum amount of potions the player can have.
|
private |
Whether or not using the potion is on cooldown.
|
private |
The amount of potions the player currently has.
|
private |
The amount a potion should heal.
|
private |
The hot key for using a potion.
|
static |
Triggers when the amount of potions changes.
|
static |
Triggers when a potion is used.