private void Update() { energy.Update(); image.fillAmount = energy.GetEnergyNormalized(); if (image.fillAmount < 0.174) { image.fillAmount = 0f; } }
private void Update() { energy.Update(); float energyAmount = energy.GetEnergyNormalized(); int energyDisplayAmaount = (int)Math.Round(energyAmount * 100); float maxEnergy = energy.MAX_ENERGY; barText.text = energyDisplayAmaount + " / " + maxEnergy; barImage.fillAmount = energyAmount; }