From 008b327c9d224caa959403abe038fd5a83e52dfa Mon Sep 17 00:00:00 2001 From: Alex Huddleston Date: Mon, 30 Apr 2018 19:24:40 -0500 Subject: [PATCH] Fixing personal goals bar. --- MoCha/Assets/Scripts/GetGoals.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index f2f61e9..cb5c15e 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -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 ();