Game Save After Closed Game

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Syncheizner
Posts: 4
Joined: Fri Dec 02, 2016 1:44 am

Game Save After Closed Game

Post 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
Syncheizner
Posts: 4
Joined: Fri Dec 02, 2016 1:44 am

Re: Game Save After Closed Game

Post by Syncheizner »

I already see example you provide , but i cant understand how it work . Hope you can help
User avatar
Tony Li
Posts: 23260
Joined: Thu Jul 18, 2013 1:27 pm

Re: Game Save After Closed Game

Post 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());
    }
} 
Syncheizner
Posts: 4
Joined: Fri Dec 02, 2016 1:44 am

Re: Game Save After Closed Game

Post by Syncheizner »

Thanks! I'll try that
Syncheizner
Posts: 4
Joined: Fri Dec 02, 2016 1:44 am

Re: Game Save After Closed Game

Post by Syncheizner »

I Have another question , can we make login and register system using this asset?
User avatar
Tony Li
Posts: 23260
Joined: Thu Jul 18, 2013 1:27 pm

Re: Game Save After Closed Game

Post 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.
Post Reply