Reorganize Assets/Battle

This commit is contained in:
henriquenakashima 2020-09-19 16:06:08 -04:00
parent 3e0004d4cb
commit abf17d8d14
20 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class EnergyUI : MonoBehaviour
{
public Text text;
public BattleController battleController;
private int renderedEnergy = -1;
private int renderedMaxEnergy = -1;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (this.renderedEnergy != battleController.GetEnergy() || this.renderedMaxEnergy != battleController.GetMaxEnergy()) {
string currentEnergyString = "" + battleController.GetEnergy();
if (battleController.GetEnergy() == 0) {
currentEnergyString = "<color=red>" + currentEnergyString + "</color>";
}
text.text = "Energy: " + currentEnergyString + " / " + battleController.GetMaxEnergy();
this.renderedEnergy = battleController.GetEnergy();
this.renderedMaxEnergy = battleController.GetMaxEnergy();
}
}
}