working stats page
This commit is contained in:
parent
c8777e958a
commit
341945e946
2 changed files with 37 additions and 0 deletions
24
MoCha/Assets/Scripts/StatsUpdate.cs
Normal file
24
MoCha/Assets/Scripts/StatsUpdate.cs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
steps.text = PlayerPrefs.GetInt("currentSteps").ToString();
|
||||||
|
score.text = PlayerPrefs.GetInt("totalPoints").ToString();
|
||||||
|
distance.text = ((float)PlayerPrefs.GetInt("currentSteps")/2000.0f).ToString() + " mi.";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
13
MoCha/Assets/Scripts/StatsUpdate.cs.meta
Normal file
13
MoCha/Assets/Scripts/StatsUpdate.cs.meta
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7edf082a74403478192a66b0b815e18b
|
||||||
|
timeCreated: 1524763129
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Reference in a new issue