Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class HealthManager : MonoBehaviour {
- [Header("Look at these")]
- //These are the stats that change
- public float CurrHealth;
- public int Damage;
- public int DamagePS;
- [Header("These are set")]
- //These stats never change
- public int MaxHealth = 100;
- public int MinHealth = 0;
- // Use this for initialization
- void Start () {
- CurrHealth = MaxHealth;
- Damage = 0;
- DamagePS = 0;
- }
- // Update is called once per frame
- void Update () {
- if (Damage >= 1) {
- CurrHealth -= Damage;
- Damage = 0;
- }
- if (CurrHealth <= 0) {
- Debug.Log ("Game Over!");
- return;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement