High Score on Mobile

Hello everyone , im making a mobile game and i have score but there is no highscore im not making online leaderboard thing , it’s my normal score code ;

void StoreHighscore(int newHighscore)
	{
		int oldHighscore = PlayerPrefs.GetInt("highscore", 0);  
		if(newHighscore > oldHighscore)
			PlayerPrefs.SetInt("highscore", newHighscore);
	}

and this code attached to the Game over screen ;

using UnityEngine;
using System.Collections;

public class Score : MonoBehaviour {
	public GUIStyle style;


	void OnGUI()
	{
		GUI.Label (new Rect (50, 50, 1000, 500), "Score :  " + PlayerPrefs.GetInt("SaveScore") , style );
		//display saved score 
	}
}

Any idea how to make high score ?

Hello,

We have developed a very easy to use asset on the store that allows easy handling of scores and high-scores across multiple devices including mobile, allowing local and online storage. It is a case of dragging in a prefab and attaching a new component allowing access to the helper functions.

The asset can be found here: Unity Asset Store - The Best Assets for Game Making

Best of luck,
Aorta