Simple question! Does PlayerPrefs.Save work on Android devices?
Yes it does work on all platforms.
Question? How would I get my code here to save my highscore int with PlayerPrefs.Save
using UnityEngine;
using System.Collections;
public class Score : MonoBehaviour {
static int score = 0;
static int highScore = 0;
static public void AddPoint() {
score++;
if(score > highScore) {
highScore = score;
}
}
void Start() {
highScore = PlayerPrefs.GetInt ("highScore", 0);
}
void OnDestroy() {
PlayerPrefs.SetInt ("highScore", highScore);
}
void Update () {
GetComponent<GUIText> ().text = "Score: " + score + "
High Score: " + highScore;
}
}