Search Unity

  1. 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. JoelAtMoodkie

    JoelAtMoodkie

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

    It's not possible for me to understand what is happening from what you've sent. Would you be able to create a self-contained script which I can drop into a scene at my end to test what is happening?

    All the best,
    Joel
     
  2. skcai

    skcai

    Joined:
    Oct 8, 2019
    Posts:
    15
    Hi,I try to replicate the problem,But it go the right color。Anyway it's good news to me :)
    Thanks so much!
     
  3. skcai

    skcai

    Joined:
    Oct 8, 2019
    Posts:
    15
    Hi,
    Here is my script.Thanks for your patience!
     

    Attached Files:

  4. JoelAtMoodkie

    JoelAtMoodkie

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

    In Step 1 you mention un-commenting the code to create your Dictionary. However, nowhere in your code does this dictionary get saved. Would you be able to open up your save file after performing this step and ensure that the correct data is in there? You can do this by going to Window > Easy Save 3 > Tools > Open Persistent Data Path, and opening the file in a text editor.

    All the best,
    Joel
     
  5. skcai

    skcai

    Joined:
    Oct 8, 2019
    Posts:
    15
    Hi,I am sure that I got the correct file at step1.

    upload_2020-1-18_18-5-25.png upload_2020-1-18_18-6-23.png
    When I set dictionary where ID =2101 value=10
    upload_2020-1-18_18-9-1.png

    I think it would be saved ,but the value is still 30.
     
  6. JoelAtMoodkie

    JoelAtMoodkie

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

    Please can you remove the attachment from this post, as you are publicly sharing the Easy Save package which is against the license agreement. In the future please private message projects to me.

    With regards to your first issue, please could you show me exactly what you're doing to create the save file? Uncommenting your code does not create the save file for me.

    With regards to your black text issue, the text appears to be white for me? Are there any steps I need to follow? Also it doesn't appear that you're using the latest version of Easy Save. Please could you try reinstalling from the Asset Store, as the black text issue was a known issue in an earlier version.

    You might also want to try using a newer version of Unity in case it's an issue with the particular version of Unity 2018 you are using.

    All the best,
    Joel
     
  7. skcai

    skcai

    Joined:
    Oct 8, 2019
    Posts:
    15
    Sorry,I have removed it .
    And will update new version file and new unity version.
    I can never thank you enough for your help!
     
  8. SwingWren

    SwingWren

    Joined:
    Mar 1, 2014
    Posts:
    11
    Hello! I'm getting and encryption error in some mac devices:

    Code (CSharp):
    1. Managed Stack Trace:
    2.  
    3. Mono.Security.Cryptography.SymmetricTransform.ThrowBadPaddingException (System.Security.Cryptography.PaddingMode padding, System.Int32 length, System.Int32 position) (at <567df3e0919241ba98db88bec4c6696f>:0)
    4. Mono.Security.Cryptography.SymmetricTransform.FinalDecrypt (System.Byte[] inputBuffer, System.Int32 inputOffset, System.Int32 inputCount) (at <567df3e0919241ba98db88bec4c6696f>:0)
    5. Mono.Security.Cryptography.SymmetricTransform.TransformFinalBlock (System.Byte[] inputBuffer, System.Int32 inputOffset, System.Int32 inputCount) (at <567df3e0919241ba98db88bec4c6696f>:0)
    6. System.Security.Cryptography.CryptoStream.FlushFinalBlock () (at <567df3e0919241ba98db88bec4c6696f>:0)
    7. System.Security.Cryptography.CryptoStream.Dispose (System.Boolean disposing) (at <567df3e0919241ba98db88bec4c6696f>:0)
    8. System.IO.Stream.Close () (at <567df3e0919241ba98db88bec4c6696f>:0)
    9. System.IO.Stream.Dispose () (at <567df3e0919241ba98db88bec4c6696f>:0)
    10. ES3Internal.AESEncryptionAlgorithm.Decrypt (System.IO.Stream input, System.IO.Stream output, System.String password, System.Int32 bufferSize) (at <42d1b56150b2432eb540e637036cbb3a>:0)
    11. ES3Internal.UnbufferedCryptoStream..ctor (System.IO.Stream stream, System.Boolean isReadStream, System.String password, System.Int32 bufferSize, ES3Internal.EncryptionAlgorithm alg) (at <42d1b56150b2432eb540e637036cbb3a>:0)
    12. (wrapper remoting-invoke-with-check) ES3Internal.UnbufferedCryptoStream..ctor(System.IO.Stream,bool,string,int,ES3Internal.EncryptionAlgorithm)
    13. ES3Internal.ES3Stream.CreateStream (System.IO.Stream stream, ES3Settings settings, ES3Internal.ES3FileMode fileMode) (at <42d1b56150b2432eb540e637036cbb3a>:0)
    14. ES3Internal.ES3Stream.CreateStream (ES3Settings settings, ES3Internal.ES3FileMode fileMode) (at <42d1b56150b2432eb540e637036cbb3a>:0)
    15. ES3Reader.Create (ES3Settings settings) (at <42d1b56150b2432eb540e637036cbb3a>:0)
    16. ES3File..ctor (ES3Settings settings, System.Boolean syncWithFile) (at <42d1b56150b2432eb540e637036cbb3a>:0)
    17. ES3File..ctor (ES3Settings settings) (at <42d1b56150b2432eb540e637036cbb3a>:0)
    18.  
    19.  
    What could be the issue?
     
  9. JoelAtMoodkie

    JoelAtMoodkie

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

    The most common causes of this exception is:

    • Encryption is enabled, but the file you're saving to/loading from isn't encrypted. To check this you can use ES3.LoadRawString to load the file as a string and output it to console. If the output isn't a garbled mess, the file isn't encrypted .
    • The encryption password differs from that used to encrypt it.
    • The file has been modified or tampered with.

    Hope this helps.

    All the best,
    Joel
     
  10. GabrielAguiarProductions

    GabrielAguiarProductions

    Joined:
    Aug 29, 2017
    Posts:
    6
    Hey there,

    So I imported the Easy Save to my project. And the biggest problem I have is that I can't turn off Auto Add Manager to Scene. I keep getting this error:

    ArgumentNullException: Value cannot be null.
    Parameter name: target
    ES3Editor.SettingsWindow.OnGUI () (at Assets/Plugins/Easy Save 3/Editor/SettingsWindow.cs:73)
    ES3Editor.ES3Window.OnGUI () (at Assets/Plugins/Easy Save 3/Editor/ES3Window.cs:101)


    And as soon as I open the Settings Tab of the ES3 Window it gets super slow.
    Tested on Unity 2019.3.0f3 and Unity 2019.3.0f6. Here's a video to better illustrate what's happening.

    https://www.dropbox.com/s/pkahveu1easz3tk/ES3_SettingsLagAndError_2019.3.0f6.mp4?dl=0


    Thanks!
     
    Last edited: Jan 30, 2020
  11. SwingWren

    SwingWren

    Joined:
    Mar 1, 2014
    Posts:
    11
    Thanks! found the problem, it seems that a crash in the save made it to leave it in an inconsistent state
     
  12. JoelAtMoodkie

    JoelAtMoodkie

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

    We’re aware of this and will be resolved in the upcoming update.

    In the meantime if you PM me your invoice number I can send you the update.

    All the best,
    Joel
     
  13. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    603
    Glad that’s working for you now.

    All the best,
    Joel
     
  14. AL_W

    AL_W

    Joined:
    Jan 25, 2016
    Posts:
    329
    Hi @joeltebbett

    Could you please help? I am not sure if I am doing this correctly. But I am trying to create keys in a save file. But Unity returns a red error telling me the "key00" save does not exist.

    Code (CSharp):
    1. void Awake()
    2. {
    3.         _es3SaveFile = new ES3File(_savePath + "config.sav");
    4.  
    5.          if (!_es3SaveFile.KeyExists("key00"))
    6.          {
    7.                _es3SaveFile.Save<bool>("key00",  key = false);
    8.           }
    9. }
     
  15. JoelAtMoodkie

    JoelAtMoodkie

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

    Are you calling ES3File.Sync at any point to store the contents of the ES3File back to a file in storage?

    I've used the following code to replicate it and it appears to work fine. The first time I run the code it outputs false, and the second time it outputs true.

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class SaveES3FileKey : MonoBehaviour
    4. {
    5.     ES3File _es3SaveFile;
    6.     bool key = true;
    7.  
    8.     void Awake()
    9.     {
    10.         _es3SaveFile = new ES3File("config.sav");
    11.  
    12.         if (!_es3SaveFile.KeyExists("key00"))
    13.         {
    14.             _es3SaveFile.Save<bool>("key00", key = false);
    15.             _es3SaveFile.Sync();
    16.         }
    17.  
    18.         Debug.Log(key);
    19.     }
    20. }
    All the best,
    Joel
     
  16. AL_W

    AL_W

    Joined:
    Jan 25, 2016
    Posts:
    329

    Sync was it!! Thanks so much o_O
     
    JoelAtMoodkie likes this.
  17. Ophtalmic

    Ophtalmic

    Joined:
    Jan 19, 2015
    Posts:
    12
    Hi, i want to create scriptable object and save variables in runtime. Example;

    • I have button for create arrow building.
    • I create arrow prefab(clone) with scriptable object. And make autosave prefab. After autosave, all prefab clones created right in every scene.
    • Arrow building have a some types. Like; building level, damage rate, damage value etc.. all variables are int type.
    1. I try to save the scriptable object variables but when i start again game scene, all building variables are the same values.
    2. How can i create seperated scriptable objects or seperated, saved variables at runtime?
    Anyone have any suggestions? Thanks.
     
    Last edited: Feb 17, 2020
  18. JoelAtMoodkie

    JoelAtMoodkie

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

    I'm assuming your ScriptableObjects are stored as fields in scripts attached to your GameObject? Because ScriptableObjects are reference types, they will typically be stored by reference.

    Firstly, if you haven't done so already, go to Window > Easy Save 3 > Types, search for the script which contains your ScriptableObject field (it's case sensitive), and then press Create ES3Type Script. This will ensure that the script is stored.

    Then to ensure the ScriptableObject is stored by value, go to Assets/Easy Save 3/Types, open ES3Type_<your type name>.cs. In the WriteComponent method you'll see a line where it writes your ScriptableObject field which looks like this:

    Code (CSharp):
    1. writer.WritePropertyByRef("so", instance.so);
    Remove the "ByRef" part of the method name so that it looks like this:

    Code (CSharp):
    1. writer.WriteProperty("so", instance.so);
    This will now store your ScriptableObject by value.

    I'm afraid I don't understand the question. Would you be able to rephrase it?

    All the best,
    Joel
     
    Ophtalmic likes this.
  19. Ophtalmic

    Ophtalmic

    Joined:
    Jan 19, 2015
    Posts:
    12
    Yes you understand right Joel, "ES3Type" is the my answer. Thanks for reply, sorry for complicated question. My brain is freezing sometimes when i work too hard. I left a little feedback on store page.
     
    Last edited: Feb 17, 2020
    JoelAtMoodkie likes this.
  20. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    35
    Hi,

    I am experimenting with Easy Save 3 for a small project and I struggle to perform simple saving and autosaving.
    When I load my save after restarting the app (or reentering playmode), it looks half broken. The materials of supposedly saved objects are pink, and not all object and prefab are loaded, sometimes they're just not there anymore.
    But loading works fine when I call it for the first time and when I haven't closed the app or exit playmode yet.

    Can anywone help me with this? Is it a known problem?

    I am using Unity 2019.3.1f1

    Thanks :)
     
  21. JoelAtMoodkie

    JoelAtMoodkie

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

    Because it is working until you leave the scene, this is almost definitely because the reference to the objects/Materials changes between loads, meaning it can no longer load the reference.

    Just to check, have you followed the Saving and Loading Prefab Instances instructions here?: https://docs.moodkie.com/easy-save-3/es3-guides/saving-loading-gameobjects-prefabs/

    All the best,
    Joel
     
  22. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    35
    Thanks for your response.

    Would there be a solution for this?

    I have, as well as the auto saving instructions.
     
  23. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    35
    Oh and here is my code for saving and loading (from UI buttons)

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine.SceneManagement;
    4. using UnityEngine;
    5.  
    6. public class GameData : MonoBehaviour
    7. {
    8.     public string dataPath;
    9.     ES3AutoSaveMgr autoSaveMgr;
    10.  
    11.     public int creatures;
    12.     public int objects;
    13.     public bool desktop;
    14.  
    15.     public GameObject savedObj;
    16.  
    17.     private void Start()
    18.     {      
    19.         //dataPath = Application.dataPath + "/GameData/" + System.Environment.UserName + "/" + SceneManager.GetActiveScene().name + ".es3";
    20.  
    21.         autoSaveMgr = GameObject.Find("Easy Save 3 Manager").GetComponent<ES3AutoSaveMgr>();      
    22.         //autoSaveMgr.settings.location = ES3.Location.File;
    23.         //autoSaveMgr.settings.directory = ES3.Directory.DataPath;
    24.         //autoSaveMgr.settings.path = dataPath;
    25.    
    26.         Load();
    27.     }
    28.  
    29.     public void OnApplicationQuit()
    30.     {
    31.        //Save();
    32.     }
    33.  
    34.     public void Save()
    35.     {
    36.         ES3.Save<GameObject>("myGameObject", savedObj);
    37.         //ES3.Save<Vector3>("SampleObjectPosition", savedObj.transform.position, dataPath);
    38.  
    39.         ES3.Save<int>("creatures", creatures);
    40.         ES3.Save<int>("objects", objects);
    41.         ES3.Save<bool>("desktop", desktop);
    42.  
    43.         autoSaveMgr.Save();
    44.     }
    45.  
    46.     public void Load()
    47.     {
    48.         ES3.LoadInto<GameObject>("myGameObject", savedObj);
    49.         //savedObj.transform.position = ES3.Load<Vector3>("SampleObjectPosition", dataPath, savedObj.transform.position);
    50.  
    51.         creatures = ES3.Load<int>("creatures", 0);
    52.         objects = ES3.Load<int>("objects", 0);
    53.         desktop = ES3.Load<bool>("desktop", false);
    54.  
    55.         autoSaveMgr.Load();
    56.     }
    57. }
    58.  
    (I can't edit my previous post anymore)
     
  24. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    603
    It can happen for a number of reasons, so it's not possible for me to tell how to resolve this for your project. Would you be able to private message me a link to a basic project and instructions to replicate it?

    Also just to check, are you loading your prefab instances in the same scene that you saved them?

    All the best,
    Joel
     
  25. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    603
    Also a quick note regarding your code, you should use ES3.Load rather than ES3.LoadInto to load your GameObject list.

    All the best,
    Joel
     
  26. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    35
    I am preparing you this.

    Yes same scene.

    Noted. I tried both to see if there is a difference.
     
  27. tlearsakura

    tlearsakura

    Joined:
    Sep 16, 2015
    Posts:
    4
    ES3.LoadImage method doesn't work in Unity 2019.3.2
     
  28. JoelAtMoodkie

    JoelAtMoodkie

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

    Please could you let me know what issues you are having? It appears to be working at our end.

    All the best,
    Joel
     
  29. tlearsakura

    tlearsakura

    Joined:
    Sep 16, 2015
    Posts:
    4
    I use this script

    Code (CSharp):
    1. watcher = new FileSystemWatcher(path, "*.jpg");
    2. watcher.Created += new FileSystemEventHandler(OnCreated);
    3.  
    4. private void OnCreated(object sender, FileSystemEventArgs e) {
    5.         print("Created file : " + e.FullPath);
    6.         Texture2D tex = ES3.LoadImage(e.FullPath);
    7.         print(tex);
    8.     }
    It doesn't work.
     
  30. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    603
    Please could you describe how it's not working? Are you getting any error messages?

    All the best,
    Joel
     
  31. tlearsakura

    tlearsakura

    Joined:
    Sep 16, 2015
    Posts:
    4
    You can try this code by yourself. It doesn't have anything happen, just use FileSystemWatcher for checking new jpg file inside folder and load them by using ES3 but no anything happen.
     
  32. JoelAtMoodkie

    JoelAtMoodkie

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

    If nothing is happening (i.e. your print() calls are not being output to console), then this suggests that your OnCreated method is not being called.

    I also notice that you're not assigning your loaded Texture to anything, so nothing will visibly change in your scene. You will need to assign it to the Material of a Renderer for it to be applied to an object.

    All the best,
    Joel
     
  33. tlearsakura

    tlearsakura

    Joined:
    Sep 16, 2015
    Posts:
    4
    Could you please create new project and test this code by yourself you'll see.

    This is full code.

    Code (CSharp):
    1. using System.IO;
    2. using UnityEngine;
    3. using UnityEngine.UI;
    4.  
    5. public class TestLoadImage : MonoBehaviour
    6. {
    7.     public Image image;
    8.  
    9.     public string path = "D:\\SomeFolder";
    10.  
    11.     FileSystemWatcher watcher;
    12.  
    13.     private void Awake() {
    14.         watcher = new FileSystemWatcher(path, "*.jpg");
    15.         watcher.NotifyFilter = NotifyFilters.LastWrite;
    16.         watcher.Created += new FileSystemEventHandler(OnCreated);
    17.         watcher.EnableRaisingEvents = true;
    18.     }
    19.  
    20.     private void OnCreated(object sender, FileSystemEventArgs e) {
    21.         print("Created file : " + e.FullPath);
    22.         Texture2D tex = ES3.LoadImage(e.FullPath);
    23.         print("tex " + tex);
    24.         image.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
    25.         image.SetNativeSize();
    26.     }
    27. }
    28.  
     
    Last edited: Mar 6, 2020
  34. JoelAtMoodkie

    JoelAtMoodkie

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

    Thanks for sending that over, I've managed to find the issue.

    You're using FileSystemWatcher, and the OnCreated callback is called in a different thread. However, Unity's Texture2D class is not thread safe, so the thread will never continue past the method which tries to load it.

    To test this, if you move the ES3.LoadImage code to the Awake() method and give it a path, it will work fine.

    A workaround for this would be to have the callback store the path in a variable, and then in Update check to see if this path variable is set. If it is, load the Texture, and then set the path variable back to null.

    All the best,
    Joel
     
  35. BIKTOP

    BIKTOP

    Joined:
    Nov 23, 2016
    Posts:
    6
    The plugin does not save data in android and ios builds. I tried all possible settings but saving doesn’t work anyway. Even for simple types like float. I use unity 2019.2.18f1
     
  36. JoelAtMoodkie

    JoelAtMoodkie

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

    It appears to be working fine at my end. Please could you put Debug.Log calls around your ES3 calls and check that the methods are being called?

    Also are you receiving any error messages? Easy Save will throw an exception if it encounters any issues.

    All the best,
    Joel
     
  37. BIKTOP

    BIKTOP

    Joined:
    Nov 23, 2016
    Posts:
    6
    I updated the id and it worked, thank you. I think you should add this item to the tutorial because the error can only be found through the debug log on the device)
     

    Attached Files:

  38. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    603
    Glad you managed to find a solution to your issue. I'll see if there's somewhere we can put this in the docs.

    All the best,
    Joel
     
  39. Kubold

    Kubold

    Joined:
    May 10, 2012
    Posts:
    344
    Not sure if this is the place to ask, but maybe some other noob will benefit from the answer.

    I am trying to have a Windows folder, from which the game loads .wav files at runtime to AudioClips, so players can have their own music in game. Very popular thing, many games have that.

    I am using Easy Save 3 PlayMaker Actions for that, but I can't get it to work and can't find any examples after googling for 40 minutes.

    1. In what folder do I put the wav files, after I make a build?
    2. What exactly do I write in the "path" filed in this action?

    So for example, I want to have a "Music" folder in the root game folder and read .wav files from there.
     

    Attached Files:

  40. JoelAtMoodkie

    JoelAtMoodkie

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

    By default data is stored in Unity's persistent data path (https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html).

    If you want to save to the root game folder then you should use Application.dataPath instead. I've attached an action which lets you get this, and also has an appendString field which allows you to append a filename to the path.

    Note that the root game folder will only exist for standalone builds and will not exist for other platforms as it is compiled into the executable.

    All the best,
    Joel
     

    Attached Files:

  41. alanmthomas

    alanmthomas

    Joined:
    Sep 7, 2015
    Posts:
    196
    Hi,
    I'm getting the following error popping up in my console that seems like it might be ES3 related.
    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.Rendering.VolumeComponent.GetHashCode () (at Library/PackageCache/com.unity.render-pipelines.core@7.1.8/Runtime/Volume/VolumeComponent.cs:206)
    System.Collections.Generic.ObjectEqualityComparer`1[T].GetHashCode (T obj) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <437ba245d8404784b9fbab9b439ac908>:0)
    ES3Internal.ES3SerializableDictionary`2[TKey,TVal].OnAfterDeserialize () (at Assets/Plugins/Easy Save 3/Scripts/ES3SerializableDictionary.cs:42)

    Any idea as to what could be causing this? I'm using Unity 2019.3.3f1 and the URP.

    Thanks!
     
  42. JoelAtMoodkie

    JoelAtMoodkie

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

    This is a bug at Unity's end as they have incorrectly implemented the GetHashCode method for the VolumeComponent, meaning it's not possible to put it into a Dictionary without throwing this error.

    If you private message me your invoice number I'll see if I can work around this at our end, and report it to Unity in the meantime.

    All the best,
    Joel
     
  43. ANUBISKONG

    ANUBISKONG

    Joined:
    Nov 16, 2016
    Posts:
    40
    Unity 2019.3.3f1
    ES 3.2.0p2

    public static bool CanBeSaved(UnityEngine.Object obj) //obj is null


    NullReferenceException: Object reference not set to an instance of an object
    ES3ReferenceMgr.CanBeSaved (UnityEngine.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgr.cs:110)
    ES3Postprocessor.AddGameObjectsAndComponentsToManager () (at Assets/Plugins/Easy Save 3/Editor/ES3Postprocessor.cs:129)
    ES3Postprocessor.OnWillSaveAssets (System.String[] paths) (at Assets/Plugins/Easy Save 3/Editor/ES3Postprocessor.cs:105)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEditor.AssetModificationProcessorInternal.OnWillSaveAssets (System.String[] assets, System.String[]& assetsThatShouldBeSaved, System.String[]& assetsThatShouldBeReverted, System.Boolean explicitlySaveAsset) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()
     
  44. JoelAtMoodkie

    JoelAtMoodkie

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

    I've not seen this issue but I'm aware of what could potentially cause this. If you private message me your invoice number I'll send over a patch for this.

    All the best,
    Joel
     
  45. haamzza

    haamzza

    Joined:
    Dec 19, 2018
    Posts:
    1
    hi am using easy save 3 but i have face some issue.
    i am building android game and my data is saved in unity when am testing, when am build an apk and installed in unity, data is not saved in mobile
    will you please help mw
     
  46. JoelAtMoodkie

    JoelAtMoodkie

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

    There was an issue like this in a previous version, but we released a patch to address it last week. Please could you confirm that you're using the latest version from the Asset Store?

    All the best,
    Joel
     
  47. VideoJames

    VideoJames

    Joined:
    Aug 23, 2012
    Posts:
    10
    Hey Joel,

    I'm getting this error when checking if a key exists.

    Code (CSharp):
    1. ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
    2. ...
    3. ...
    4. ES3Internal.AESEncryptionAlgorithm.Decrypt (System.IO.Stream input, System.IO.Stream output, System.String password, System.Int32 bufferSize) (at Assets/Plugins/Easy Save 3/Scripts/ES3Crypto.cs:139)
    My code:
    Code (CSharp):
    1. if (!ES3.KeyExists(key, new ES3Settings(ES3.EncryptionType.AES, Password))) return "";
    Thank you for your help.
     
  48. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    603
    Hi James,

    Firstly, could you go to Window > Easy Save 3 > Settings and check that the buffer size is not zero. You should also check that your password variable isn't an empty string.

    If that's not the issue, this is usually caused when the password doesn't match. Could you try the following code and see if you get the same issue?

    Code (CSharp):
    1. var settings = new ES3Settings(ES3.EncryptionType.AES, "password");
    2. ES3.Save<string>("key", "thisIsAValue", "testfile.es3", settings);
    3. if(ES3.KeyExists("key", "testfile.es3", settings))
    4.     Debug.Log("Encryption is working correctly");
    All the best,
    Joel
     
  49. Kubold

    Kubold

    Joined:
    May 10, 2012
    Posts:
    344
    Thank you for the Action, it works well, it gets a path to a string.

    Yet I still can't load wav files, this error appears:


    Streaming of 'mpeg' on this platform is not supported
    UnityEngine.Networking.DownloadHandlerAudioClip:GetContent(UnityWebRequest)
    ES3:LoadAudio(String, AudioType, ES3Settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:521)
    ES3PlayMaker.LoadAudio:Enter() (at Assets/Plugins/Easy Save 3/PlayMaker/ES3PlayMaker.cs:423)
    ES3PlayMaker.ActionBase:OnEnter() (at Assets/Plugins/Easy Save 3/PlayMaker/ES3PlayMaker.cs:39)
    HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
    HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
    HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2771)
    HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2718)
    HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2643)
    HutongGames.PlayMaker.Fsm:Start() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1926)
    PlayMakerFSM:Start() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:558)

    I'm on a regular PC, this appears in Editor and in standalone build. Am I doing something wrong here?
    Btw. I tried 8, 16 and 24 bit wav files, as well as .ogg files - same result. I know Unity doesn't support mp3 files for some legal reasons, but in this case it looks like it thinks all my wav and ogg files are mpegs. I just want to be sure if it's not something hardcoded in the Action.
     
    Last edited: Mar 24, 2020
  50. VideoJames

    VideoJames

    Joined:
    Aug 23, 2012
    Posts:
    10
    Thanks Joel,

    The issue was that I wasn't using the filepath parameter.
     
unityunity