Fixing personal goals bar.

This commit is contained in:
Alex Huddleston 2018-04-30 19:24:40 -05:00
parent 2b48b84ca9
commit 008b327c9d

View file

@ -19,6 +19,10 @@ namespace PedometerU.Tests
public Image pbbg;
public Image pbf;
// My Goal Progress Bar
public Image mgpbbg;
public Image mgpbf;
// Monster Progress Bar
public Image mpbbg;
public Image mpbf;
@ -146,6 +150,21 @@ namespace PedometerU.Tests
temp.anchoredPosition = new Vector2 (temp.rect.width * 0.5f - (barSize.x * 0.5f),0);
}
// Use this for the progress bar you're testing with.
public void updateMyGoalProgressBar()
{
//Debug.Log (pbbg.rectTransform.rect.width + " " + pbbg.rectTransform.rect.height);
barSize.x = mgpbbg.rectTransform.rect.width;
//tempcounter += 0.0005f;
// resize the fill.
RectTransform temp = mgpbf.rectTransform;
//temp.sizeDelta = new Vector2 (-barSize.x + barSize.x * tempcounter, 0);
temp.sizeDelta = new Vector2 (-barSize.x + (barSize.x * barDisplay), 0);
temp.anchoredPosition = new Vector2 (temp.rect.width * 0.5f - (barSize.x * 0.5f),0);
}
// Call this to update the monster's progress bar.
public void updateMonsterProgressBar()
{
@ -197,6 +216,9 @@ namespace PedometerU.Tests
{
updateTimeRemaining ();
updateProgressBar ();
updateMyGoalProgressBar ();
if(prefKey == "daily")
{
updateMonsterProgressBar ();