Bunch of stuff, working saves

This commit is contained in:
nexovec committed 2022-01-30 00:05:42 +01:00
1 parent 758c83cfd2
commit 2bcc48139d
2 files changed
+22 -5

No files matched your search

+5 -2
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()