Quantcast
Channel: Answers by "Elit3d"
Viewing all articles
Browse latest Browse all 20

Answer by Elit3d

$
0
0
If you are using 4.6 unity it is much easier to do it like this: using UnityEngine; using UnityEngine.UI; using System.Collections; public class ShowScore : MonoBehaviour { static int highScore = 0; public Text guiText; void Start () { PlayerPrefs.GetInt("highScore",highScore); highScore = PlayerPrefs.GetInt ("highScore", highScore); } void Update() { guiText.text = "HS: " + highScore; } } I haven't tested it so if you get any errors let me know. Just wrote it on the spot so probably has errors, maybe not. Hope this helps **EDIT**: It is very important you include using **UnityEngine.UI;** on top otherwise you will encounter errors!

Viewing all articles
Browse latest Browse all 20

Latest Images

Trending Articles





Latest Images