Bunch of stuff, working saves

This commit is contained in:
2022-01-30 00:05:42 +01:00
parent 758c83cfd2
commit 2bcc48139d
2 changed files with 22 additions and 5 deletions

View File

@@ -25,8 +25,11 @@ public class UiController : MonoBehaviour
}
public static void SaveGame()
{
PlayerPrefs.SetInt("HighestScore", (int)UiController.distance);
PlayerPrefs.Save();
if (UiController.distance > UiController.highScore)
{
PlayerPrefs.SetInt("HighestScore", (int)UiController.distance);
PlayerPrefs.Save();
}
Debug.Log("Game data saved!");
}
static void LoadGame()