using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Scoring : MonoBehaviour 
{
	public float highScore = 0;

	void Start () 
	{
	//get the highscore from player prefs if it is there, 0 otherwise.
		highScore = PlayerPrefs.GetFloat("highScore", 0);
	}

	public bool SetScore(float score)
	{
		if (score > highScore) {
			PlayerPrefs.SetFloat ("highScore", score);
			PlayerPrefs.Save ();
			highScore = score;
			return true;
		} else
			return false;
	}
}