added new progress bar, should all work...
This commit is contained in:
parent
499a0aedfd
commit
d8ad2def11
1 changed files with 5 additions and 7 deletions
|
@ -85,7 +85,7 @@ namespace PedometerU.Tests
|
|||
|
||||
void Start ()
|
||||
{
|
||||
PlayerPrefs.DeleteAll(); //danger!!
|
||||
//PlayerPrefs.DeleteAll(); //danger!!
|
||||
if(prefKey == "daily")
|
||||
{
|
||||
// This should later only get called per goal
|
||||
|
@ -134,9 +134,9 @@ namespace PedometerU.Tests
|
|||
userPoints = savedPoints;
|
||||
|
||||
//OnStep(savedSteps, 0); //necessary?
|
||||
Debug.Log(savedSteps);
|
||||
//Debug.Log(savedSteps);
|
||||
|
||||
Debug.Log(pbbg.rectTransform.anchoredPosition.x.ToString() + " " + pbbg.rectTransform.anchoredPosition.y.ToString());
|
||||
//Debug.Log(pbbg.rectTransform.anchoredPosition.x.ToString() + " " + pbbg.rectTransform.anchoredPosition.y.ToString());
|
||||
|
||||
//barPos = new Vector2(pbbg.transform.position.x, 1895 - pbbg.transform.position.y);
|
||||
|
||||
|
@ -227,7 +227,6 @@ namespace PedometerU.Tests
|
|||
{
|
||||
updateTimeRemaining ();
|
||||
updateProgressBar ();
|
||||
|
||||
//updateMyGoalProgressBar ();
|
||||
|
||||
if(prefKey == "daily")
|
||||
|
@ -258,23 +257,22 @@ namespace PedometerU.Tests
|
|||
PlayerPrefs.SetInt(currentStepsKey, userSteps);
|
||||
}
|
||||
//goal complete
|
||||
if(barDisplay >= 1.0f)
|
||||
else if(barDisplay >= 1.0f)
|
||||
{
|
||||
Debug.Log(prefKey + "... Goal complete! +100pts!");
|
||||
userSteps = 0;
|
||||
PlayerPrefs.SetInt(currentStepsKey, userSteps);
|
||||
savedSteps = 0;
|
||||
//OnStep(0,0);
|
||||
stepText.text = userSteps.ToString () + "/" + stepsGoal.ToString();
|
||||
|
||||
//destroy the goal and set a new one?
|
||||
savedPoints += stepsGoal*10;
|
||||
PlayerPrefs.SetInt(totalPointsKey, savedPoints);
|
||||
pointsText.text = "Points: " + PlayerPrefs.GetInt(totalPointsKey).ToString ();
|
||||
|
||||
//Random item
|
||||
if(!PlayerPrefs.HasKey("inventory"))
|
||||
PlayerPrefs.SetString("inventory", "");
|
||||
//Random item
|
||||
StringBuilder invList = new StringBuilder ();
|
||||
invList.Append(PlayerPrefs.GetString ("inventory"));
|
||||
invList.Append(items[(int)Math.Round(UnityEngine.Random.value*6.0f)]).Append(" ");
|
||||
|
|
Reference in a new issue