Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //****** Donations are greatly appreciated. ******
- //****** You can donate directly to Jesse through paypal at https://www.paypal.me/JEtzler ******
- var saving : boolean = true;
- function Start() {
- OnLoad();
- autoSaveEnable();
- }
- function autoSaveEnable() {
- while(saving) {
- yield WaitForSeconds(5);
- Debug.Log("save me");
- OnSave();
- }
- }
- function OnSave() {
- PlayerPrefs.SetInt("CurXp", playerHealth.curXp);
- }
- function OnLoad() {
- Debug.Log("loaded");
- playerHealth.curXp = PlayerPrefs.GetInt("CurXp");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement