Hi,
I am a bit confused about how to use the save system.
I have the four components (SaveSystem, Json...) from tutorial attached to the dialogue manager.
Then I let my button perform a bit of code
Are there any errors or warnings in the Console window?
If you're playing in the Unity editor's play mode, does Unity freeze? Or can you exit play mode?
In the scene that you're loading, is there anything that might call LoadGame() again when the scene starts? This could put the game into an infinite loop.
Hi,
No error messages at all. The entire unity would freeze (i.e. I cannot minise the window or exit play mode ect). After a while it would unfreeze and that's it.
I don't have any other trigger for loading scenes other than the button click, so I think the game is not in a loop.
1. Close and reopen Unity. This will create a fresh Editor.log file (see here for location of file).
2. Reproduce the issue.
3. When Unity unfreezes, don't do anything else in Unity. Examine the Editor.log file. If you jump to the bottom of the file, it should indicate what was going on when Unity froze.
Unloading 59 unused Assets to reduce memory usage. Loaded Objects now: 7742.
Total: 69.504000 ms (FindLiveObjects: 0.535100 ms CreateObjectMapping: 0.305500 ms MarkObjects: 68.605400 ms DeleteObjects: 0.057200 ms)
Unloading 3 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 0.630900 ms
Loaded scene 'Temp/__Backupscenes/0.backup'
Deserialize: 2.348 ms
Integration: 29.993 ms
Integration of assets: 0.669 ms
Thread Wait Time: 0.010 ms
Total Operation Time: 33.020 ms
System memory in use before: 167.5 MB.
System memory in use after: 168.0 MB.
Unloading 59 unused Assets to reduce memory usage. Loaded Objects now: 7742.
Total: 69.308400 ms (FindLiveObjects: 0.502200 ms CreateObjectMapping: 0.272500 ms MarkObjects: 68.470100 ms DeleteObjects: 0.062900 ms)
Here are the last couple of lines
Unloading 3 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 0.647500 ms
Loaded scene 'Temp/__Backupscenes/0.backup'
Deserialize: 2.329 ms
Integration: 30.431 ms
Integration of assets: 0.692 ms
Thread Wait Time: 0.010 ms
Total Operation Time: 33.462 ms
System memory in use before: 167.4 MB.
System memory in use after: 168.0 MB.
Unloading 59 unused Assets to reduce memory usage. Loaded Objects now: 7742.
Total: 69.557800 ms (FindLiveObjects: 0.498700 ms CreateObjectMapping: 0.262800 ms MarkObjects: 68.736800 ms DeleteObjects: 0.058800 ms)
Refresh completed in 0.008523 seconds.
RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
RefreshProfiler: Total: 7.774ms
<RI> Initialized touch support.
yes, the pattern is "Unloading 3 Unused Serialized files" and "Unloading 59 unused Assets to reduce memory usage. ". They are repeated many many times and it seems that is pretty much all it is doing.
The log has got 120199 lines and over 5MB in size. Majority of them are "Unloading 3 Unused Serialized files" and "Unloading 59 unused Assets to reduce memory usage. "
Thank you for sending the project. I replied to your email. The problem is that the Update() method was adding another "SaveGame" and "LoadGame" to the UI buttons every frame. I attached a fixed version of the script that uses the Start() method instead and also uses the SaveSystem class.