mirror of
https://github.com/ConjureETS/Human-Farm-Tycoon.git
synced 2026-03-24 18:31:07 +00:00
Added some functions to the Stats script. Added the HungerScript to manage the hunger bars.
29 lines
834 B
C#
29 lines
834 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
using UnityEngine.UI;
|
|
|
|
public class HungerScript : MonoBehaviour {
|
|
|
|
public Slider sliderZombie;
|
|
public Slider sliderHumans;
|
|
private Stats stats;
|
|
|
|
// Use this for initialization
|
|
void Start()
|
|
{
|
|
stats = GameObject.Find("Stats").gameObject.GetComponent<Stats>();
|
|
sliderHumans.maxValue = stats.MaxHungerHuman;
|
|
sliderZombie.maxValue = stats.MaxHungerZombies;
|
|
sliderHumans.value = sliderHumans.maxValue;
|
|
sliderZombie.value = sliderZombie.maxValue;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
sliderHumans.maxValue = stats.MaxHungerHuman;
|
|
sliderZombie.maxValue = stats.MaxHungerZombies;
|
|
sliderHumans.value = stats.AmountOfHHunger;
|
|
sliderZombie.value = stats.AmountOfZHunger;
|
|
}
|
|
}
|