This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
mochapine64backup/MoCha/Assets/Scripts/StatsUpdate.cs

38 lines
1.2 KiB
C#
Raw Normal View History

2018-04-26 12:34:20 -05:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Text;
public class StatsUpdate : MonoBehaviour {
public Text score;
public Text steps;
public Text distance;
public Text calories;
2018-04-26 12:34:20 -05:00
// Use this for initialization
void Start () {
//steps.text = PlayerPrefs.GetInt("currentSteps").ToString();
steps.text = PlayerPrefs.GetInt("fitbitSteps").ToString();
2018-04-26 12:34:20 -05:00
score.text = PlayerPrefs.GetInt("totalPoints").ToString();
//distance.text = ((float)PlayerPrefs.GetInt("currentSteps")/2000.0f).ToString() + " mi.";
distance.text = PlayerPrefs.GetFloat("fitbitDistance").ToString() + " mi.";
calories.text = PlayerPrefs.GetInt("fitbitCalories").ToString();
}
public void refreshPrefs() {
//steps.text = PlayerPrefs.GetInt("currentSteps").ToString();
steps.text = PlayerPrefs.GetInt("fitbitSteps").ToString();
score.text = PlayerPrefs.GetInt("totalPoints").ToString();
//distance.text = ((float)PlayerPrefs.GetInt("currentSteps")/2000.0f).ToString() + " mi.";
distance.text = PlayerPrefs.GetFloat("fitbitDistance").ToString() + " mi.";
calories.text = PlayerPrefs.GetInt("fitbitCalories").ToString();
2018-04-26 12:34:20 -05:00
}
// Update is called once per frame
void Update () {
}
}