Page 1 of 1

Game Save After Closed Game

Posted: Fri Dec 02, 2016 1:49 am
by Syncheizner
Hi , i want to ask how to save all the player record even i closed game? Current i'm use game saver and persistent active data. But nothing happen ,
Thanks

Re: Game Save After Closed Game

Posted: Fri Dec 02, 2016 2:22 am
by Syncheizner
I already see example you provide , but i cant understand how it work . Hope you can help

Re: Game Save After Closed Game

Posted: Fri Dec 02, 2016 9:14 am
by Tony Li
Hi,

If you want to save on quit and reload on start, it's easier to use a small script like this, added to your Dialogue Manager:

Autosave.cs

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;

public class Autosave : MonoBehaviour {

    public string saveKey = "SavedGame";
    
    void Start() {
        if (PlayerPrefs.HasKey(saveKey)) PersistentDataManager.ApplySaveData(PlayerPrefs.GetString(saveKey));
    }
    
    void OnApplicationQuit() {
        PlayerPrefs.SetString(saveKey, PersistentDataManager.GetSaveData());
    }
} 

Re: Game Save After Closed Game

Posted: Sat Dec 03, 2016 11:31 am
by Syncheizner
Thanks! I'll try that

Re: Game Save After Closed Game

Posted: Sat Dec 03, 2016 11:32 am
by Syncheizner
I Have another question , can we make login and register system using this asset?

Re: Game Save After Closed Game

Posted: Sat Dec 03, 2016 3:18 pm
by Tony Li
Syncheizner wrote:I Have another question , can we make login and register system using this asset?
No, the Dialogue System isn't a good fit for that. You might try something like WordPress Login.