This is my script,I want that the “number” (variable Counter) saved in an earlier scene It script looks if it is over the highscore and if it is save it and remember it as a highscore in another scene, I dont know that bad: S this is the one I use for another scene:
var Counter : int;
function Start(){
Debug.Log(Counter);
Counter = PlayerPrefs.GetInt("Score");
guiText.text = "Score: "+Counter;
}
and it works for me but now another scene and saved as highscore failing me that not only saves the previous runs, and I want to save the highest and if is lowest do nothing. What could I do?
var Counter: int;
var highscore: int;
function Start (){
Counter = PlayerPrefs.GetInt("Score");
}
function Update (){
if(Counter>highscore);
{
highscore = Counter;
guiText.text = "Normal Map HighScore : " +highscore.ToString();
PlayerPrefs.SetInt("highscore",highscore);
}
}
Thanks, I wish it running!.