Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

CharacterHealth.cs

Erik edited this page Apr 26, 2019 · 7 revisions

Dependencies (What do I need to include to use this script in another project?):
  • None
Public Methods:
  • ResetHealth() - Restores the character to maximum health
  • TakeDamage(int damage) - Removes damage from health (cannot go below 0)
  • Heal(int healthAmount) - Adds healthAmount to health (cannot go above maxHealth)
Public Events:
  • HealthChanged - Invoked when damage or healing is done.
  • OnDeath - Invoked when health reaches 0.
Configurable Fields:
  • health
  • maxHealth
General Overview:

Holds and maintains the player's current health. If health ever goes below 0, it is set to 0. If health ever goes above maxHealth, it is set to maxHealth.

Clone this wiki locally