Progress bar hooked up with pedometer
This commit is contained in:
parent
1d11f0c3dd
commit
f3c4d0b610
2 changed files with 3 additions and 1 deletions
Binary file not shown.
|
@ -29,9 +29,11 @@ public class GetGoals : MonoBehaviour {
|
||||||
int userSteps;
|
int userSteps;
|
||||||
double userDistance;
|
double userDistance;
|
||||||
int totalSteps = 30;
|
int totalSteps = 30;
|
||||||
|
public Text stepText;
|
||||||
|
|
||||||
void OnStep (int steps, double distance) {
|
void OnStep (int steps, double distance) {
|
||||||
userSteps = steps;
|
userSteps = steps;
|
||||||
|
stepText.text = steps.ToString ();
|
||||||
userDistance = (distance * 3.28084);
|
userDistance = (distance * 3.28084);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +103,7 @@ public class GetGoals : MonoBehaviour {
|
||||||
//needs the total required points for this goal
|
//needs the total required points for this goal
|
||||||
currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
||||||
//barDisplay = Time.time*0.05f; //put actual progress here (current/total)
|
//barDisplay = Time.time*0.05f; //put actual progress here (current/total)
|
||||||
barDisplay = userSteps/totalSteps;
|
barDisplay = (float)userSteps/(float)totalSteps;
|
||||||
//failed to complete goal
|
//failed to complete goal
|
||||||
if(currentDayStr != goalDayStr)
|
if(currentDayStr != goalDayStr)
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue