Hello, i want to reset my score back to zero when game restarts. my score scripts loads score from one scene to another, that is fine for me but when it game over and it restart the old score still shows. i want it to restart back to zero.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class ScoreManager : MonoBehaviour
{
public static int score;
Text text;
void Awake ()
{
text = GetComponent <Text> ();
score = 0;
score = PlayerPrefs.GetInt ("Score");
}
void Update ()
{
text.text = "Score: " + score;
PlayerPrefs.SetInt ("Score", score);
}
}