private void UpdateProgressBar() { double val = new OreClick().getProgress(); float ratio = (float)(val / max); //need to make sure it doesn't go over 100... currentProgress.transform.localScale = Vector3.Scale(transform.localScale, new Vector3(ratio, 1f, 1f)); barText.text = val.ToString() + '%'; }
private void increaseProgress() { double val = new OreClick().getProgress(); if (val > 100) { val = max; } UpdateProgressBar(); }