Well, I’m beginner in unity and I am using this script to the score and record . When my character dies he carries the Game Over Scene , and only shows the record , the score is reset. As for the score appears on the scene Game Over? And how do I score zero when the “Play” scene restart ?
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Manager : MonoBehaviour {
public Text Highscore;
public Text Score;
public int score = 0;
// Use this for initialization
void Start () {
Highscore.text = " " + PlayerPrefs.GetInt ("Highscore");
Score.text = " " + score;
}
// Update is called once per frame
void Update () {
if (score > PlayerPrefs.GetInt ("Highscore")) {
PlayerPrefs.SetInt("Highscore", score);
}
Score.text = " " + score;
}
}