Class PropertiesSample
This class manages the scene for showcasing the Properties system.
Inherited Members
Namespace: UnityEngine.GameFoundation.Sample
Syntax
public class PropertiesSample : MonoBehaviour
Fields
healButton
Declaration
public Button healButton
Field Value
Type | Description |
---|---|
Button |
mainText
We will need a reference to the main text box in the scene so we can easily modify it.
Declaration
public Text mainText
Field Value
Type | Description |
---|---|
Text |
takeDamageButton
References to the specific buy/sell buttons to enable/disable when either action is not possible.
Declaration
public Button takeDamageButton
Field Value
Type | Description |
---|---|
Button |
wrongDatabasePanel
Reference to the panel to display when the wrong database is in use.
Declaration
public GameObject wrongDatabasePanel
Field Value
Type | Description |
---|---|
GameObject |
Methods
Heal()
Increases the player's health by the health restore property of a health potion, then removes it. This only happens if there is at least one health potion in the inventory, and if the player's health is not maxed out.
Declaration
public void Heal()
TakeDamage()
Apply the sword's damage value to the player's health.
Declaration
public void TakeDamage()