using UnityEngine;
using System.Collections;

public class CreditsController : MonoBehaviour {

	public static int rhinosSaved;

	public UILabel creditsLabel; // inspector
	public UILabel bestLabel; // inspector

	public void Start() {
		int bestScore = PlayerPrefs.GetInt ("bestScore");
		if (bestScore < rhinosSaved) {
			bestScore = rhinosSaved;
			PlayerPrefs.SetInt ("bestScore", bestScore);
		}
		creditsLabel.text = "We saved " + rhinosSaved + " rhinos from the hands of mad warriors lug tribes under a vaguely Eastern-European communist regime in a distopian future.\n\nCan you do better?";
		bestLabel.text = "Best score so far: " + bestScore + " rhinos saved";
	}

	public void OnTryAgain() {
		Application.LoadLevel ("menu");
	}
}
