Load Ocasionally Fails When Restarting Unity
Posted: Tue Jul 26, 2022 8:00 am
Hello Toni,
I've run into a very frustrating bug; I'm not quite sure what the cause of it is.
Here is how I reproduce the bug,
I eventually found that here, while applying the data, when the bug does occurs, the fields of data were null; talkingTo would be null, and the elements of the lists were all null as well:
The save file seems to be fine; after all, the load doesn't always fail. And it's not just this class that's affected. I believe only fields are hold references are affected (although, again, not 100% sure. )
Have you seen anything like this before?
PS: Forgot to mention that I’m using the EasySave3 integration.
Best,
Malek
I've run into a very frustrating bug; I'm not quite sure what the cause of it is.
Here is how I reproduce the bug,
- I save the game while testing it.
- As long as I don't restart Unity, loading the game works fine. (To be honest, I'm not 100% sure this is true, but it hasn't happened yet. )
- I restart Unity, enter play mode, and load the game until the load fails. This usually takes between 1-10 restarts.
Code: Select all
/// <summary>
/// Saves the knowledge the player has learned.
/// </summary>
public class InkStateManagerSaver : Saver
{
[Serializable]
public class InkStateManagerData
{
public Character talkingTo;
public List<Presentable> allKnown;
public List<Presentable> allPresentableRepliesKeys;
public List<Presentable> allPresentableRepliesValues;
}
Code: Select all
if (string.IsNullOrEmpty(s)) return;
var data = SaveSystem.Deserialize<InkStateManagerData>(s);
if (data == null) return;
Have you seen anything like this before?
PS: Forgot to mention that I’m using the EasySave3 integration.
Best,
Malek