Forum rules - please read before posting.

Autosave on quit for iOS

Hi,

Maybe this is more of a Unity question, but is there any way to run an action list, basically only to do an Autosave, when the player closes the app window for an iOS game?

// Magnus

Comments

  • I can't say how succesful this would be - as I'm not sure how much access Unity has to load/save processes when the game is quit - but script-wise this would do it:

    using UnityEngine;
    using AC;
    
    public class AutoSaveOnQuit
    {
        [RuntimeInitializeOnLoadMethod]
        static void RunOnStart()
        {
            Application.quitting += Quit;
        }
    
        static void Quit()
        {
            SaveSystem.SaveAutoSave ();
        }
    }
    
  • Thanks a lot for this as well. I made the script monobehavior and included it in the scenes. Works great most of times but not others. I guess it has to do with timing around how quickly the app is fully closed (swiped off the screen) after the window has been closed so will keep experimenting. Thanks a lot for this!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.