i know i need to use Playerprefs but i dont know how. tried a couple of things i saw online but still didnt help. here is my current scoring code,please how i can i modify it to sava high score.
var currentScore:int;
var startScore:int;
var point:String;
var speed:int=2;
var bestScore:int=0;
var lastBestScore:int=0;
var hasLost:boolean=false;
function Start () {
}
function Update () {
if(!hasLost){
Scorer();
}
//else if player has lost
else {
point="Your Score:" + currentScore.ToString() + "
Your Best:" + bestScore;
if(bestScore>lastBestScore) point+="
New Record!!";
guiText.text=point;
}
}
function Scorer(){
currentScore=startScore+Time.timeSinceLevelLoad*speed;
Show();
}
function Show(){
point=currentScore.ToString();
guiText.text=point;
}
function StopScore(){
hasLost=true;
lastBestScore=bestScore;
if(currentScore>bestScore){
bestScore=currentScore;
}
}