Fixing personal goals bar.
This commit is contained in:
parent
2b48b84ca9
commit
008b327c9d
1 changed files with 22 additions and 0 deletions
|
@ -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 ();
|
||||
|
|
Reference in a new issue