Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Easy Save - The Complete Save Data & Serialization Asset

Discussion in 'Assets and Asset Store' started by JoelAtMoodkie, May 28, 2011.

  1. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    This is undocumented as it's only used internally, so you shouldn't change this.

    All the best,
    Joel
     
  2. JamesXyXz

    JamesXyXz

    Joined:
    Aug 2, 2021
    Posts:
    12
    Can you change your autoSave? AutoSave doesn't consider saveScenes (optional). Map0001 and Map0002 have the same structure. When it save things in Map0001 then it automatically save in Map0002 too. If there are the same structure in different scenes I wanna choose between save global and save local. Example mouse sensitivity should been saved in all scenes, but bestTimes/highscores should been saved individually (each scene). I think it is not so complicated for you. Individually save/load something like save path "Map0001/CheckpointRoute" and "Map0002/CheckpointRoute".
    Easy01.jpg
     
  3. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    This wouldn’t be possible because it would be impossible for Easy Save to know that two scene structures are the same. Although to a human they may look identical, to the software each scene contains different objects with different reference IDs … it would be impossible for the software to know that you consider reference A in scene 1 and reference B in scene 2 as the same object.

    All the best,
    Joel
     
  4. JamesXyXz

    JamesXyXz

    Joined:
    Aug 2, 2021
    Posts:
    12
    But the other should be easier possible, that Easy Save could detect Scenes, example Map0001 and Map0002 to save scenes individually. I think this is important.
    To find same objects should be possible too.
    Automatically: Find by Name. Different reference IDs is no matter, because Easy Save should only command to save/load each of this things in different scenes individually, but update each other.
    Manually: With connection identify. Behind an object there could be a variable which is
    manually entered. Easy Save can detect same variable names.
     
  5. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    I'm not sure I understand. Auto Save does save scenes individually? I.e. each scene contains an Easy Save 3 Manager with it's own ES3AutoSaveMgr Component.

    Names are not unique in Unity, so they cannot be used to uniquely identify an object in the way you describe.

    If you're going to the effort of doing it manually then the benefit of Auto Save would be negated anyway, and you might as well use code to save and load.

    If you want to achieve what you've described, you should use code, not Auto Save. This will allow you to tell Easy Save what object relates to what in a way which would be non-trivial for a user to do through a GUI.

    All the best,
    Joel
     
  6. JamesXyXz

    JamesXyXz

    Joined:
    Aug 2, 2021
    Posts:
    12
    This automatically should not be a problem anymore (for mouse sensitivity [global]), because of pass variable through scenes.


    Auto Save does save scenes individually?
    I found a solution. Everytime when I save a scene as I have to delete EasySave3Manager from the new scene and add it again.
     
  7. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    I'm afraid that doesn't address the issue I mentioned. That video just describes how to use static variables.

    Just to clarify, I won't be able to provide any further support for this particular issue apart from to say that my recommendation is to use the code API.

    All the best,
    Joel
     
  8. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    497
    Hello,

    I got a simple question - where and how do we save checkpoints? Are they suppose to be saved on disk or stored in memory? I have the ability to save your game by going to a safe place but also I'd like to have check points from time to time and I won't have use to keep them on disk, because if you alt+f4 I want to load the save and not the check point.
     
  9. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    If you want checkpoints to be stored in memory then you should put them in a variable rather than saving them. Easy Save is for saving data.

    Alternatively if you do need to use Easy Save, you could save the data to a separate file to your save file, and delete it when necessary.

    All the best,
    Joel
     
    Last edited: Oct 20, 2021
  10. aaandyan

    aaandyan

    Joined:
    Jan 16, 2020
    Posts:
    3
    Hi Joel,

    I am trying to load a CSV File I exported from Google Sheets with all my enemy stats into my game.

    Here is what I have tried:
    I placed the csv file in the same directory where my save files are being made.
    I followed your Loading a Spreadsheet Guide but using Playmaker Actions (In the screenshot attached).

    ES3 Spreadsheet Create
    ES3 Spreadsheet Load
    Es3 Spreadsheet Get Cell

    I still get returned an error... System.ArgumentNullException: Value cannot be null
    Is there something I am missing?


    Screenshot (116).png
     
  11. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    There are quotation marks in your file path, making it an invalid path, so removing them will resolve the error.

    I've made a change at our end so that it will throw an appropriate error when there are quotation marks in the path.

    All the best,
    Joel
     
    Last edited: Oct 31, 2021
  12. aaandyan

    aaandyan

    Joined:
    Jan 16, 2020
    Posts:
    3
    Thank you for the timely response,

    I removed the quotations but I still get the following error.
    My file Enemy_Stats.CSV is in the exact same directory as the SaveFile.ES3 (the persistent data path)

    System.ArgumentNullException: Value cannot be null.
    Parameter name: stream
    at System.IO.StreamReader..ctor (System.IO.Stream stream, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean leaveOpen) [0x00016] in <567df3e0919241ba98db88bec4c6696f>:0
    at System.IO.StreamReader..ctor (System.IO.Stream stream, System.Boolean detectEncodingFromByteOrderMarks) [0x0000d] in <567df3e0919241ba98db88bec4c6696f>:0
    at System.IO.StreamReader..ctor (System.IO.Stream stream) [0x00000] in <567df3e0919241ba98db88bec4c6696f>:0
    at (wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(System.IO.Stream)
    at ES3Spreadsheet.Load (System.IO.Stream stream, ES3Settings settings) [0x00001] in C:\Users\aaand\Downloads\WebRTC Video Chat v0.9843\New Unity Project\Assets\Plugins\Easy Save 3\Scripts\ES3Spreadsheet.cs:119
    at ES3Spreadsheet.Load (ES3Settings settings) [0x00001] in C:\Users\aaand\Downloads\WebRTC Video Chat v0.9843\New Unity Project\Assets\Plugins\Easy Save 3\Scripts\ES3Spreadsheet.cs:104
    at ES3Spreadsheet.Load (System.String filePath, ES3Settings settings) [0x00001] in C:\Users\aaand\Downloads\WebRTC Video Chat v0.9843\New Unity Project\Assets\Plugins\Easy Save 3\Scripts\ES3Spreadsheet.cs:99
    at ES3PlayMaker.ES3SpreadsheetLoad.Enter () [0x00001] in C:\Users\aaand\Downloads\WebRTC Video Chat v0.9843\New Unity Project\Assets\Plugins\Easy Save 3\PlayMaker\ES3PlayMaker.cs:976
    at ES3PlayMaker.ActionBase.OnEnter () [0x00002] in C:\Users\aaand\Downloads\WebRTC Video Chat v0.9843\New Unity Project\Assets\Plugins\Easy Save 3\PlayMaker\ES3PlayMaker.cs:42

    Screenshot (117).png
     
    Last edited: Oct 31, 2021
  13. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    Please could you replicate this in a new project containing only the latest version of Easy Save, PlayMaker and a simple scene which replicates it and private message it to me with instructions.

    All the best,
    Joel
     
  14. skcai

    skcai

    Joined:
    Oct 8, 2019
    Posts:
    23
    Hey Joel,
    I used Es3 to load file from Application.streamingAssetsPath.It works well on Ios,but in android project it fail to load the same file.
    Here is my code:
    ===========================
    sting tmpPath = Application.streamingAssetsPath + "/ComatLevel";
    string jsonString = ES3.Load<string>("comat", tmpPath, new ES3Settings(ES3.EncryptionType.AES, "ddneiane!!"));
    ===========================

    And the error from android studio:
    ===========================
    2021-11-01 23:30:57.879 3028-3064/com.Skcai.Wushan E/Unity: FileNotFoundException: File "orage/emulated/0/Android/data/com.Skcai.Wushan/files/jar:file:///data/app/com.Skcai.Wushan-1/base.apk!/assets/ComatLevel" could not be found.
    at ES3.Load[T] (System.String key, ES3Settings settings) [0x00035] in <b3b90e42096e47d789b14281317a947e>:0
    at ES3.Load[T] (System.String key, System.String filePath, ES3Settings settings) [0x00008] in <b3b90e42096e47d789b14281317a947e>:0
    at MainManager.FPOAKNLJEAL (System.String filePath) [0x00054] in <06f6be70e8e8481a929cfca5ecf9b2a1>:0
    at MainManager.Awake () [0x00114] in <06f6be70e8e8481a929cfca5ecf9b2a1>:0
    ===========================

    I find maybe it fail to creat ES3Reader where(the code in Es):
    ===============
    using (var reader = ES3Reader.Create(settings))
    {
    if (reader == null)
    throw new System.IO.FileNotFoundException("File \"" + settings.FullPath + "\" could not be found.");
    return reader.Read<T>(key);
    }
    ================
    But I don't konw why and how to fix it.Could you help remind me what's wrong I maded?
    Best,
    Skcai
     
  15. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    The Streaming Assets Path is not accessible on Android as it is compiled into the APK. Please see Unity's documentation for more information:
    https://docs.unity3d.com/ScriptReference/Application-streamingAssetsPath.html

    All the best,
    Joel
     
    skcai likes this.
  16. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,514
    Hi @JoelAtMoodkie
    Is there Async alternative for ES3.LoadRawString?
    Thanks
     
  17. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    You can put ES3.LoadRawString in your own separate thread if you require it to work asynchronously.

    Like Unity, we avoid adding our own async methods because it’s very easy to get into trouble with them if you don’t know what you’re doing (race hazards, etc), especially in an engine like Unity which puts extra focus around the main thread.

    All the best,
    Joel
     
    jGate99 likes this.
  18. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,514
    Agreed :)
     
  19. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    Hi, new to Easy Save, want to ask 3 questions:

    - Can the Auto Save feature remember object deletion? It seems like on load, the system is able to "Diff" loaded data with existing scene objects, but if during gameplay I "replace" a scene object (delete then add), on next load both the deleted object and added object are present.

    - If not, are we supposed to "clear scene object if save exist, then load save"?

    - One tricky problem I see is: some of unity store asset author put multiple MeshCollider component on the same game object, it works physics wise, but based on your document, Easy Save can only handle 1 MeshCollider per object, correct? Do we have to "fix" these assets?
     
  20. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    One more problem, it seems like Easy Save can lose reference on load:

    - Say I have a prefab with ComponentA and ComponentB, both I have explicitly serialized with ES types.

    - And my ComponentA has a serialized field that reference ComponentB.

    - Now I dynamically spawn the prefab at runtime, on save, I can see it does serialize to save file, eg. A's field does contain a ES3Ref that points the same ES3Ref as B.

    - But on next load, the reference is lost, the field becomes null, and I can see warning that this ES3Ref ID is not found in the reference manager.

    Does it mean: if I dynamically spawn objects, and if my dynamic object has fields that reference other component on the same object, ES3 doesn't know the reference is still valid? Can we re-register the these ids?
     
  21. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    To answer my own question, it appears the right solution is to turn them into prefabs AND mark them as ES Prefab.

    What ES3 Prefab does is to store a set of local reference, I assume this turn the global reference lookup into local lookup, thus we won't lose any reference stored within the prefab. Including both the case of multiple mesh collider and the case of ComponentA referencing ComponentB.
     
  22. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    Answer my question: this approach does work, but the Destroy() and ES3.Load() call cannot be in the same frame, otherwise reference manager doesn't have time to response to change.

    (sorry for my spam everyone)
     
  23. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    Auto Save cannot manage object deletion as it would be impossible for it to know what has been deleted due to how Easy Save manages deleted states. As you suggest, one solution is to delete everything and then reload from the save file.

    Another alternative is a script which stores the destroyed state for GameObjects which are not dynamically created. If you private message me your invoice number then I can send to a script which does this.

    All the best,
    Joel
     
  24. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    That is correct. Calling the Destroy method only marks something to be destroyed. Unity doesn’t actually destroy it into the end of the frame.

    All the best,
    Joel
     
  25. Andreas12345

    Andreas12345

    Joined:
    Oct 17, 2013
    Posts:
    450
    I like to see an example for basic use:
    save to a file, where the user can name the save file(To have different saves)
    Load a file where the player can load the save file he want to load.
    I have only one prefab in scene that gets changes.
    I dont find an example
     
  26. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    To specify the file name you simply specify the filePath parameter of the ES3.Save and ES3.Load methods. See the docs for more info:

    https://docs.moodkie.com/easy-save-3/es3-guides/settings-paths-locations/

    How you get the input from the user is a UI question rather than an Easy Save question, so I recommend consulting Unity’s documentation regarding this.

    All the best,
    Joel
     
  27. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    335
    I'm in a rush right now but I have tested deleting the ES3GlobalReferences.asset file, as discussed here and there #1490.
    It was including files in the build that had no reason to be there.

    ES3 does not recreate the file even if in Settings I tick "Use global references". I'm not sure what is going to happen next. Should we expect problems if a new file of type where to reappear in our project?

    As for "Auto Update References", it keeps doing it whether the box is ticked or not, so the only solution I found thus far is to deactivate the Easy Save 3 Manager GO in the scene. Keeping it deactivated in builds doesn't seem to prevent ES3 from working even after saving many scenes since the last time it was active.
     
  28. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    ES3GlobalRerefences will only regenerate itself if there is an Easy Save 3 Manager in your scene which needs updating.

    You only need to add a manager to your scene if you’re using Auto Save or saving/loading reference types.

    All the best,
    Joel
     
  29. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    Hi Joel,

    Is there an API or Editor script that can quickly refresh a ES3 Prefab id that's attached on a prefab?

    I would like to create some prefab variant or new prefabs based on existing prefabs, but currently design means the prefab id will remain unchanged from the original prefab.

    Thx!
     
  30. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    The following code from an Editor script would generate a new ID:
    Code (CSharp):
    1. yourPrefab.GetComponent<ES3Prefab>.prefabId = ES3Prefab.GetNewRefID();
    All the best,
    Joel
     
    bitinn likes this.
  31. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    Thx, just a quick follow up, as we have refreshed the prefab id in this case, is it necessary to also clear the localRefs dictionary and refresh reference manager? Or are these local ids truly "local" so duplicate doesn't matter?
     
  32. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    No need to clear the localRefs or refresh the manager. The localRefs are truly local, as you suggest :)

    All the best,
    Joel
     
    bitinn likes this.
  33. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    Hmm, I am running into an issue serializing reflection probe inside a prefab, the resulting json seems incorrect:

    Screen Shot 2021-12-10 at 23.37.04.png

    And it causes a format exception:

    Screen Shot 2021-12-10 at 23.39.19.png
     
  34. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    Maybe I shouldn't serialize it this way? The auto-generated code did suggest it is trying to find the correct type for these enums when writing them, feels like a bug to me.

    Screen Shot 2021-12-10 at 23.44.42.png

    Screen Shot 2021-12-10 at 23.49.53.png
     
  35. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    What's more intriguing, the serialization of reflection probe only failed for 1 of the prefab instance; the other instance is serialized fine, and I can see they have the same prefab id.

    Screen Shot 2021-12-10 at 23.57.38.png

    (sorry for my spam)
     
  36. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    I don’t appear to be able to replicate this. Are you using the latest version of Easy Save? If so, please could you replicate this in a new project with a simple scene and private message it to me with instructions.

    All the best,
    Joel
     
  37. rmacgillis

    rmacgillis

    Joined:
    Feb 5, 2014
    Posts:
    2
    Hello,

    Before I mention my problem , I want to say I appreciate this great program.

    I've had no issues saving custom types since I've been using ES3 for quite awhile

    Now recently when I try to save a type I get the error:

    "Cannot load from file because the data in it is not JSON data , or the data is encrypted "

    Well, encryption is off.

    Things I've tried:
    -Clear data path
    -using older versions of easysave, but still get JSON format error

    I don't get it because I have the latest version of ES3 and there's no errors in Saving/Loading those older types I made Type scripts for.

    The only thing that's changed recently with my computer is updating to Win 10.

    Thanks for any help
     
  38. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911

    Hi Joel, so I looked at the flow of Writer more carefully, I think there are multiple issues here:

    - First, the default code-gen for reflection probe enums is incorrect, if I changed it to following, the enums are serializing just fine (see commented code-gen vs working code).

    Screen Shot 2021-12-11 at 11.56.10.png

    - But there is a second issue, Reflection Probe use Cubemap instead of Texture2D on properties such as customBakedTexture, it is not a part of the supported texture types, and the default code-gen cause a cast error:

    Screen Shot 2021-12-11 at 12.01.44.png

    - This is however caused by Easy Save assuming the customBakedTexture type is Texture2D, my question is how can I read it as a Cubemap and NOT get casted to Texture2D; do I need to create a custom Cubemap type??

    Screen Shot 2021-12-11 at 12.12.51.png

    Screen Shot 2021-12-11 at 12.28.50.png

    TL;DR: knowing that Easy Save 3 doesn't support Cubemap, but I just want to load a static Cubemap texture, do I still need to write a Cubemap ES3Type?
     
    Last edited: Dec 11, 2021
  39. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    For posterity, 1 way to handle Cubemap serialization is to rely on these API(s):

    - First, during write property, save the Cubemap's id via GetNativeTexturePtr():

    Code (CSharp):
    1.  
    2. writer.WriteProperty("customBakedTexture", instance.customBakedTexture.GetNativeTexturePtr());
    3.  
    - Second, during read property, create the Cubemap via CreateExternalTexture() API:

    Code (CSharp):
    1.  
    2. var textureId = reader.Read<IntPtr>();
    3. instance.customBakedTexture = Cubemap.CreateExternalTexture(128, TextureFormat.BC6H, true, textureId);
    4.  
    - No serialization of Cubemap class is needed in this case as we serialize pointer value, but we also skipped the Easy Save's reference system (we didn't save the Cubemap reference id).

    - This is not how
    ES3Type_Texture2D
    handle the situation, so I imagine Joel might have some alternative solutions to this.

    My question for Joel is: If we do save the Cubemap (texture)'s local reference id, how can I reference the texture without invoking Texture2D()? If we can do that, then I can call GetNativeTexturePtr() and thus construct a Cubemap without serializing its data.
     
  40. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    Unfortunately it wouldn't be possible for me to understand what is happening from what you've said. Please could you replicate this in a new project and private message it to me with instructuons.

    All the best,
    Joel
     
  41. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Could you clarify what you mean by "invoking Texture2D()"?

    All the best,
    Joel
     
  42. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911

    reader.Read<UnityEngine.Texture>(ES3Type_Texture.Instance);


    This code always cast texture to Texture2D because it is what
    ES3Type_Texture
    does internally.

    But IF I know the texture is a Cubemap, there must be some way for me to cast it to Cubemap instead of Texture2D??

    This is where
    ES3Type_Texture2D
    does its cast:

    Screen Shot 2021-12-11 at 19.04.35.png
     
  43. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    911
    OK my final solution was to hack the ES3Type_Texture2D type, and add my ES3Type_Cubemap into the plugin directory to handle Cubemap textures: instead of letting it call the Texture2D cast, we ReadInto a Cubemap instance, similar to how the
    obj.GetType() == typeof(RenderTexture))
    conditional block works.

    My previous solution using GetNativeTexturePtr() was pretty great, but only works in editor, in build it creates a SEGV crash unfortunately. (Not sure if I should blame Unity's Metal implementation, because CreateExternalTexture() relies heavily on graphic API.)
     
  44. rmacgillis

    rmacgillis

    Joined:
    Feb 5, 2014
    Posts:
    2
    I created a bare-bones project with just the save/load methods for my types and got no errors. So I guess that means it could be some conflict with another script in my main project? I could also try loading my project into a newer version of Unity, since I've noticed my current 2019.4.8ft can be buggy. So I'll try some more things first....
     
  45. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    As you mention, if you always know that it's going to be a Cubemap, you should use the Cubemap type. I.e.

    Code (CSharp):
    1. reader.Read<Cubemap>();
    All the best,
    Joel
     
  46. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    I would definitely recommend updating to the latest long-term support version of 2019 (currently 2019.4.33f1) to begin with. If this doesn't resolve the issue, it does seem to point to an issue with the logic in your code or settings using a different save location. If you post the code you're using to save and load, and a screenshot of your Tools > Easy Save 3 > Settings window I'm happy to take a look to see if there's anything obviously wrong with the Easy Save part of your implementation.

    All the best,
    Joel
     
  47. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    296
    How does one go about using Autosave but also keep track of the Scene to it can load the scene then apply the data??

    I tried using Autosave with load, but scene did not update so I have to assume Scene Names are not being saved?
    I know you need to save scene data like this ES3.Save(SceneManager.GetActiveScene().name, "savedScene");
    but how do you combine that With autosave and auto load?
    Can you please provide an example of how to do that?

    This is how my main menu is calling the event:
    public void LoadGameButton() { ES3AutoSaveMgr.Current.Load(); }
     
  48. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    Hi there,

    Auto Save is for saving supported GameObjects and their Components, not for switching scenes.

    To do this you would need to load the scene using code, and then call Auto Save. For example:

    Code (CSharp):
    1. // To save
    2. ES3.Save("sceneName", SceneManager.GetActiveScene().name);
    3.  
    4. // To load
    5. if(ES3.KeyExists("sceneName"))
    6.     SceneManager.LoadScene( ES3.Load<string>( "sceneName" ) );
    All the best,
    Joel
     
  49. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    296
    Fantastic ty,
    So I had the right idea. So that means I can use manual save as well as the auto save functionality and they won't conflict? I already have AutoSave set up. Sorry, I'm new to useing this and doesn't really know its limitations just yet.
     
  50. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    762
    That is correct, as long as you’re not saving the same data with both.

    All the best,
    Joel
     
unityunity