Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Easy Save - The Complete Save & Load Asset for Unity

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

  1. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    211
    I honestly do not know how this asset has so many good reviews.

    It has completely crashed my game. And it is throwing me this error:

    FormatException: Expected ',' separating properties or '"' before property name, found 'n'.
    ES3Internal.ES3JSONReader.ReadPropertyName () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:63)
    ES3Internal.ES3JSONReader.Goto (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:198)
    ES3Reader.Read[T] (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:157)
    ES3.Load[T] (System.String key, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:269)
    ES3.Load[T] (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:240)
    AvatarCreator.Start () (at Assets/_Scripts/AvatarCreator.cs:177)

    I am almost at the end of a job..almost finished this damn game for a client.
    And out of no where Easy Save 3 is throwing me these errors...completely out of no where...and since I coded Easy 3 in my project from the very beginning....it has completely stuffed my entire project.
     
    Last edited: Nov 23, 2020
  2. JoelAtMoodkie

    JoelAtMoodkie

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

    We've not had any reports of this issue, and I don't appear to be able to replicate it from your stack trace. Please could you private message me a basic project which replicates it along with your save file? Your save file can be found by going to Window > Easy Save 3 > Tools > Open Persistent Data Path.

    I also recommend deleting your save data by going to Window > Easy Save 3 > Tools > Clear Persistent Data Path.

    All the best,
    Joel
     
  3. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    211
    That seemed to have solved it. Thanks
     
  4. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    667
    Glad that resolved your issue.

    During development it's sometimes necessary to delete the save file to account for changes in your serialisation structure. If this happens again, if you send me your save file I'll be able to provide more information.

    All the best,
    Joel
     
    markashburner likes this.
  5. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    89
    Hi Joel
    im working on project where i need to save UI data (From InputField, DropDown.value .... etc).
    To do that, i made some scripts attached to my Sub-Elements UI (Ex : UserData.cs (InputFild name , age ..))
    in each script i set specific key and save-load functions for and variables to be saved.
    like : UserData.cs (string ScriptKey, string m_name , string m_age...). everything works

    Now Save and Load is easy to specific path (Save precedent values, load and attache them to UI elements).
    Problem
    Saving many data to one file (Like 100 scripts with different keys takes a lot of time(2 min to save)).
    i would be grateful for any suggestions about this issue.
     
  6. JoelAtMoodkie

    JoelAtMoodkie

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

    There's information on improving performance in this scenario in the Improving Performance guide:
    https://docs.moodkie.com/easy-save-3/es3-guides/performance/

    All the best,
    Joel
     
  7. serjightu

    serjightu

    Joined:
    Mar 1, 2019
    Posts:
    3
    Hi Joel, I can't figure out how to save my variables to a CSV file.
    I used the documentation

    var sheet = new ES3Spreadsheet ();

    // Add data to cells in the spreadsheet.
    for (int col = 0; col <10; col ++)
    for (int row = 0; row <8; row ++)
    sheet.SetCell (col, row, "someData");

    sheet.Save ("mySheet.csv");

    But I can run it, is there an easy way for me to write my variables to a CSV file in a simple way.
    Thanks for the answer.
     
  8. JoelAtMoodkie

    JoelAtMoodkie

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

    I'm afraid I'm not sure what the question is here?

    All the best,
    Joel
     
  9. sarynth

    sarynth

    Joined:
    May 16, 2017
    Posts:
    98
    Wrote a little utility struct. Happy with how it turned out and wanted to share.

    Code (CSharp):
    1. using System;
    2.  
    3. namespace Core
    4. {
    5.     [Serializable]
    6.     public struct GameSaveData
    7.     {
    8.         public string sceneName;
    9.         public int savePointId;
    10.  
    11.         public static GameSaveData Get()
    12.         {
    13.             return ES3.Load(nameof(GameSaveData), new GameSaveData
    14.             {
    15.                 sceneName = "",
    16.                 savePointId = -1
    17.             });
    18.         }
    19.  
    20.         public static void Save(GameSaveData gameSaveData)
    21.         {
    22.             ES3.Save(nameof(GameSaveData), gameSaveData);
    23.         }
    24.  
    25.         public static void Save(string sceneName, int savePointId)
    26.         {
    27.             Save(new GameSaveData
    28.             {
    29.                 sceneName = sceneName,
    30.                 savePointId = savePointId
    31.             });
    32.         }
    33.     }
    34. }
     
    JoelAtMoodkie and UnityGISTech like this.
  10. Fressbrett

    Fressbrett

    Joined:
    Apr 11, 2018
    Posts:
    31
    Hey there! First of all, amazing asset, saved me a lot of hustle already (pun intended).

    Is it possible to load an object, which implementation has changed (i.e. a field has been added/removed)?

    I am using EasySave to load/save data, but further down the line there might come more data to the objects being saved. As soon as I ship my product and users create savefiles, I would like those to still be loadable even if some fields have been added (or maybe removed).

    How does easysave handle mismatching fields within object saves?
     
  11. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    667
    Hi there, and thanks for the pun :D

    Any fields which exist in the save data but don't exist in the class will be skipped.

    Any fields for which there is not save data will be set to their default values (i.e. fields which have been added to the class). The next time the class is saved, the new field will be saved (assuming it's serializable).

    Hope this helps :)

    All the best,
    Joel
     
    Fressbrett likes this.
  12. Fressbrett

    Fressbrett

    Joined:
    Apr 11, 2018
    Posts:
    31
    Perfect, that is exactly the kind of behaviour I needed :D thanks!
     
  13. RemDust

    RemDust

    Joined:
    Aug 28, 2015
    Posts:
    337
    Hey Joel !
    Thank you for this asset :)

    I'm having a hard time understanding a real world scenario using ES3.
    What I'm trying to do to begin with is keeping perstistence on a fairly simple gameobject (not a prefab yet).

    Right now I'm using ES3 auto-save script on my gameobject. When player dies, I'm calling this before the respawn :
    if (ES3AutoSaveMgr._instance != null)
    ES3AutoSaveMgr._instance.Save();

    I load the level once again and on Start, i call instance.Load().

    For some reason, it doesn't work. Any help would be really appreciated :)

    [EDIT]
    Also, I set Save Event and Load Event to none in the Auto Save panel and when I get in Play Mode they reset to On App Quit and Awake (the default value), don't really know why.
     
    Last edited: Dec 25, 2020
  14. JoelAtMoodkie

    JoelAtMoodkie

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

    Could you create a new project with a very basic scene which replicates this and private message it to me so I can see what is happening?

    All the best,
    Joel
     
  15. cmart

    cmart

    Joined:
    Jul 10, 2012
    Posts:
    121
    Hi there, Ive been using Easy Save 3 for the last few months and it works great.

    One question I have, is how to do multiple save files? In my game I would like to have 3 save slots available to the player, and 2 reserved for special game modes.

    Is there a way to create a new save file, and then make ES3 reference this based on which save slot is selected? What I mean is the (by default) "SaveFile.es3" located in the persistent data path directory, is it possible to make "SaveFile1" "SaveFile2" "SaveFile3" and so on?

    Or Do we need to have something like ES3.Save<int>("Save1_PlayerHP", 100),ES3.Save<int>("Save2_PlayerHP", 100), ES3.Save<int>("Save3_PlayerHP", 100) etc.


    I would much prefer to just point to a unique file, as it would keep the code much cleaner :)


    Thanks for any help/advice!
     
  16. sarynth

    sarynth

    Joined:
    May 16, 2017
    Posts:
    98
    I was going to over-complicate this. I started to create multiple classes to wrap ES3 and I created "MySaveSettings" and "MySaveHandler" etc. Then I realized it was a bit easier than that.

    Code (CSharp):
    1.             // Determine where to save the file. *.json or *.dat.
    2.             var path = GeneratePath(gameStats);
    3.  
    4.             // Can we put this in an async callback?
    5.             // Save the game stats.
    6.             ES3.Save(nameof(GameStats), gameStats, path);
    7.  
    8.             // Save the path of the last save game for "continue."
    9.             ES3.Save("lastPath", path);
    I have a function to generate a path based on the gameStats I want to save. In my gameStats I have a filename, so generate path is basically "folder/{gamestats.filename}.json" so that there are unique paths.

    In the second line is where it is really easy. Simply put the different path you want. And it'll save to that file instead of the default file.

    I then save a "lastPath" variable in the main default save file, so I can quickly lookup what the last save was, and re-load it when the player presses continue.
     
  17. JoelAtMoodkie

    JoelAtMoodkie

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

    You can change the default save file at runtime using the ES3Settings.defaultSettings.path variable.

    All the best,
    Joel
     
  18. cmart

    cmart

    Joined:
    Jul 10, 2012
    Posts:
    121
    Hi guys, thanks for the help but Im still a little confused. I guess my first question is, how do I create multiple save files to work with?

    How do I (and players using builds outside the editor) create SaveFile1, SaveFile2, SaveFile3?

    At that point, I could then use ES3Settings.defaultSettings.path = ""; to change what savefile the game is actively using?

    A very simple scenario, the game starts with 3 buttons "Save 1" "Save 2" and "Save 3" when the player clicks on the button, I run a little script that sets the ES3Settings.defaultSettings.path = to the coresponding save file, and then all my subsequent code will point at that save file until ES3Settings.defaultSettings.path = is changed?

    Thanks for the help I appreciate it
     
  19. sarynth

    sarynth

    Joined:
    May 16, 2017
    Posts:
    98
    Try:

    Code (CSharp):
    1. ES3.Save("Example", "One", "save1.json");
    2. ES3.Save("Example", "Two", "save2.json");
    3. ES3.Save("Example", "Three", "save3.json");
    Or whatever file extension you're using. That should create your three files.
     
    JoelAtMoodkie and cmart like this.
  20. JoelAtMoodkie

    JoelAtMoodkie

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

    Save files are automatically created when you call ES3.Save.

    So for example if you set your default save file to MyFile.es3, and then call ES3.Save("myKey", myData), a file called MyFile.es3 will automatically be created containing that data.

    All the best,
    Joel
     
    cmart likes this.
  21. cmart

    cmart

    Joined:
    Jul 10, 2012
    Posts:
    121
    I see, thanks guys! Ill give it a shot

    Edit: Works great, thanks for the help!
     
    Last edited: Dec 28, 2020
    JoelAtMoodkie and sarynth like this.
  22. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Hi Joel, will this plugin work when Apple give to player to choose disable or enable IDFA for players ?
    So when players will turn off idfa, plug-in couldn’t load saves, I think so.
     
  23. JoelAtMoodkie

    JoelAtMoodkie

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

    Easy Save doesn’t use any advertising tokens, so IDFA shouldn’t apply to us. Unless you know something we don’t?

    All the best,
    Joel
     
  24. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Hi! sry! i thought to use IDFA as players id in cloud was in your docs) but it was our idea.

    PS now everybody can use SystemInfo.deviceUniqueIdentifier and it will work perfectly.
     
  25. AlejandroRivasMistwall

    AlejandroRivasMistwall

    Joined:
    Oct 21, 2020
    Posts:
    3
    Hi, when try load path es3 say:
    ArgumentNullException: Value cannot be null.
    Parameter name: stream
    System.IO.StreamReader..ctor (System.IO.Stream stream, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean leaveOpen) (at <9577ac7a62ef43179789031239ba8798>:0)
    System.IO.StreamReader..ctor (System.IO.Stream stream, System.Boolean detectEncodingFromByteOrderMarks) (at <9577ac7a62ef43179789031239ba8798>:0)
    System.IO.StreamReader..ctor (System.IO.Stream stream) (at <9577ac7a62ef43179789031239ba8798>:0)
    (wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(System.IO.Stream)
    ES3Spreadsheet.Load (System.IO.Stream stream, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3Spreadsheet.cs:144)
    ES3Spreadsheet.Load (ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3Spreadsheet.cs:129)
    ES3Spreadsheet.Load (System.String filePath) (at Assets/Plugins/Easy Save 3/Scripts/ES3Spreadsheet.cs:119)
    ConversationData.Load (System.String Path) (at Assets/Scripts/Gameplay/ConversationManager.cs:81)
    ConversationData..ctor (System.String path) (at Assets/Scripts/Gameplay/ConversationManager.cs:73)
    ConversationManager.Awake () (at Assets/Scripts/Gameplay/ConversationManager.cs:35)

    Some one can help me ?
    File.Exist that system.io say my directory exist
     
  26. JoelAtMoodkie

    JoelAtMoodkie

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

    Please could you private message me a new, basic project which replicates this so I can see what is happening at my end?

    All the best,
    Joel
     
  27. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,051
    Hi, Does this work with Nintendo Switch too? It seems persistentdatapath access trial occurs error (crash) even before game start on Switch dev device.

    error :
    --------

    [LocalFileSystemSwitch::CreateAsDir] Trying to write to 'rom:' mount path 'rom:/Data/%HOMEPATH%'!
    ****** FS ERROR INFORMATION ******
    Error: Error occurred at CreateDirectory().
    nn::fs::ResultUnsupportedOperation: Error: Unsupported operation.
    More infomation may be provided by enabling 'FS Access Log Mode' at 'DevMenu: Debug'.
     
  28. JoelAtMoodkie

    JoelAtMoodkie

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

    We cannot support for Switch as Nintendo requires a middleware license which they do not provide to Asset Store publishers.

    Some customers have had success integrating Easy Save with Nintendo's storage API using the instructions here, and I believe there may be threads on the Nintendo forum regarding this which may be helpful. However, I would be unable to assist any further.

    All the best,
    Joel
     
    SweatyChair and sarynth like this.
  29. CaptCollins

    CaptCollins

    Joined:
    Jan 27, 2016
    Posts:
    13
    Hey man! Just got the asset (cause potato brain) and im having a little trouble getting started, Im just trying to save and load scenes but its not working out.

    My save code is:
    ES3.Save(SceneManager.GetActiveScene().name, "savedScene");

    My load code is:
    levelToLoad = ES3.Load<string>("savedScene");
    SceneManager.LoadScene(levelToLoad);

    Is this somewhere in the right direction? Its making a save file but not specifically saving the "savedScene" I dont think? Getting an error saying "savedScene could not be found" when trying to load. Just trying to follow a youtube tutorial, i dont do so good without visual examples. Any helps appreciated!
     
  30. JoelAtMoodkie

    JoelAtMoodkie

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

    The first parameter to the ES3.Save method is the key, but you're providing the data you're trying to save as the first parameter.

    Please see the Getting Started guide for more info:
    https://docs.moodkie.com/easy-save-3/getting-started/

    All the best,
    Joel
     
  31. CaptCollins

    CaptCollins

    Joined:
    Jan 27, 2016
    Posts:
    13
    Yeah thats what I get for blindly following a tutorial. That fixed it! Thanks dude.
     
  32. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    35
    Hey there!
    Ive had this asset for awhle and it works great for saving small pieces of data, map gen settings and so on, but when i try to actually save an object filled with instantiated prefabs, it saves it, but when i load it just completely clears the scene and loads absolutely nothing, my parent objects all have autosave scripts with save children enabled. And i have set up prefab saving for all my prefabs (or at least i think thats working properly, the file seems to have the data.) Capture.PNG Capture2.PNG How it looks.PNG
    And then i try to load and:

    When i load everything just disappears (as it should), but nothing loads: Capture5.PNG Loaded Nothing.PNG
     
  33. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    35
    Loaded Nothing.PNG AfterLoadPNG.PNG Heres the basic saving and loading code: GenerateStructureForLoading Simply deletes everything and adds in the "base" objects (Eg an empty Players, Units and Cells object and associates the cell grid script to those so the game will run properly afterwards, after it is supposedly done loading it then initializes everything. But since it isn't loading anything nothing gets initialized right now. So any idea why it isnt loading when i run my load code?
    CodePNG.PNG
     
  34. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    35
    Heres part of the list of prefabs so you can see that easy save sees them
    PrefabList.PNG
     
  35. JoelAtMoodkie

    JoelAtMoodkie

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

    Unfortunately I won't be able to replicate this from what you've said. Please could you create a new project with a very basic scene which replicates your issue and private message it to me? This should be as simple as possible just so it can be isolated to Easy Save.

    All the best,
    Joel
     
  36. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    35
    Updating easy save and using json "somewhat alleviated the issue, its just not putting stuff into the right parent now and thats easily fixable
     
  37. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    35
    Now when i load its loading the players correctly, but when it tries to load the cells it doesn't load their children at all and doesn't put them into a cells object. GameObject.PNG Capture.PNG Capture.PNG
     
    Last edited: Jan 17, 2021
  38. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    35
    Ive decided to just not use teh autosave feature, and to just manually save stuff, got the players loading by themselves fine now
     
  39. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    35
    Good news, its working and loading stuff now, but the only issue now is that when i load it loads everything but it loads extra copies of the stuff inside my game objects (which were instaiated from prefabs and then saved)
    How it looks after loading:
    Capture.PNG

    How it should look:
    Capture2.PNG

    The code:
    Capture3.PNG

    I figure its something simple i'm missing, these objects are prefabs that were instantiated at runtime: Inside of the saved object. (With save children checked to true)

    On the documentation it basically says to save and load them just like game objects.

    Am i missing something?
    https://docs.moodkie.com/easy-save-3/es3-guides/saving-loading-gameobjects-prefabs/#saving-and-loading prefab instances


    Unless it means i have to save each individual prefab type separately?

    I could just delete the "extra" objects, but that would be messy and slow and im sure im missing something simple.

    It works fine for prefabs that don't have extra "levels" to them.
     
    Last edited: Jan 18, 2021
    sarynth likes this.
  40. JoelAtMoodkie

    JoelAtMoodkie

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

    Please could you create a new project with a very basic scene which replicates this and private message it to me with instructions?

    Also just to check, are you on the latest version of Easy Save from the Asset Store?

    All the best,
    Joel
     
  41. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    35
    yes I am on the latest version, i even said that in my previous post, do you really need a basic scene to debug this? How ar screenshots and explanations and code not enough?

    I figured it was a simple issue with my saving code, but you are saying the above code should work just fine?

    I dont have much time, for creating superfluous projects. I work on my games in my (limited) free time.
    Create a prefab with a couple levels to it, enable auto save for that prefab, set es3 to save by value rather then by reference, save to a persistent data path and set a new file name before saving, instantiate a few of those prefabs into an object via code, save and load the object they are in, with children set to true.
     
    Last edited: Jan 18, 2021
  42. JoelAtMoodkie

    JoelAtMoodkie

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

    We have basic tests at our end which replicate saving and loading prefabs which works at our end, which means that there is something in your project which we've not been able to replicate. Creating a basic project will allow you to isolate the issue to Easy Save so that we can debug it at our end. Unity has the same requirement when asking for support from them also, as it's extremely difficult to debug an issue without a repro project.

    If you private message me your invoice number I can send over our upcoming update which might address your issues, but otherwise I would need to see a project to replicate this so that I can debug it.

    All the best,
    Joel
     
  43. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    35
    goddamnit, will do when I have time, which wont be until tonight. Do re-look at the workflow i described and see if its unique somehow in the mean time if you can.
     
  44. lukezinsan

    lukezinsan

    Joined:
    Jan 16, 2014
    Posts:
    6
    upload_2021-1-27_8-21-28.png

    hi.. i got error like this..
    the script is simple just load and save int value
     
  45. JoelAtMoodkie

    JoelAtMoodkie

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

    As the error suggests, there is no save data to load from. You should check that save data exists before loading it if you're not sure whether a save file is going to exist, or provide the defaultValue parameter.

    For more info please read the Getting Started guide.

    All the best,
    Joel
     
  46. krenar_

    krenar_

    Joined:
    Dec 11, 2020
    Posts:
    3
    @JoelAtMoodkie I think ES3.Save might have a problem. When I call method SetData, code stops executing at line where ES3.Save is called. Also in persistent data path, two files are created: "SaveFile.es3" and "SaveFile.es3.tmp".

    I already tried clearing persistent data path multiple times, and tweaking code, however nothing seems to work.

    I have also added ES3 manager to scene.

    Please check code below.

    Code (CSharp):
    1. using UnityEngine;
    2. using Facebook.Unity;
    3. using Firebase.Auth;
    4.  
    5. public class UserAuthenticator : MonoBehaviour
    6. {
    7.     [HideInInspector]
    8.     public bool loggedIn;
    9.     [HideInInspector]
    10.     public string userId;
    11.  
    12.  
    13.     #region Singleton vars
    14.     public static UserAuthenticator instance;
    15.     #endregion
    16.  
    17.     private void Awake()
    18.     {
    19.         #region singleton implementation
    20.         if (instance == null)
    21.         {
    22.             instance = this;
    23.         }
    24.         else if (instance != this)
    25.         {
    26.             Destroy(gameObject);
    27.         }
    28.         #endregion
    29.  
    30.         DontDestroyOnLoad(gameObject);
    31.  
    32.         LoadData();
    33.  
    34.     }
    35.  
    36.  
    37.     public void LoadData()
    38.     {
    39.         if (ES3.KeyExists("authUserData"))
    40.         {
    41.             ES3.LoadInto("authUserData", this);
    42.         }
    43.         else if (Application.internetReachability != NetworkReachability.NotReachable && FB.IsLoggedIn)
    44.         {
    45.             SetData(true, FirebaseAuth.DefaultInstance.CurrentUser.UserId);
    46.             Debug.Log($" key authUserData doesn't exist, but has internet connection and it is logged in in fb. Logged in: {loggedIn}");
    47.         }
    48.         else
    49.         {
    50.             SetData(false);
    51.             Debug.Log($" key authUserData doesn't exist and it's not connected to internet or it's not logged in with FB. Logged in: {loggedIn}");
    52.         }
    53.     }
    54.  
    55.     public void SetData(bool loggedIn, string userId = "")
    56.     {
    57.         this.loggedIn = loggedIn;
    58.         this.userId = userId;
    59.  
    60.         print("Started saving");   //This line is printed to console
    61.  
    62.         ES3.Save("authUserData", this); //This is where code stuck. No exception is thrown
    63.  
    64.         print("save complete");  //This line is NOT printed to console
    65.     }
    66. }
    67.  
     
  47. JoelAtMoodkie

    JoelAtMoodkie

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

    Please could you create a new project with a very basic scene which replicates this and private message it to me? Also you might want to check that you have errors enabled in the console.

    All the best,
    Joel
     
  48. krenar_

    krenar_

    Joined:
    Dec 11, 2020
    Posts:
    3
    Hi, I think i can't replicate this exact problem. I created new unity project but it worked just fine. Sorry for inconvenience.
     
  49. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    667
    Let me know if you do manage to replicate it and I'll be happy to look into it :)
     
    krenar_ likes this.
  50. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    193
    Is there a possibility that the ES3Globalreferences.asset might save data that shouldn't be there and will force the build to include assets that are useless?
    I'm not too well informed on what this asset does exactly. Can it be purged and should it be (done manually)?
     
unityunity