Fix Unity stripping ISaveDataLocation classes in some cases#33
Fix Unity stripping ISaveDataLocation classes in some cases#33NoixDeXydre wants to merge 1 commit into
Conversation
|
Hi This is a good spot, will likely get a little time this evening to look at it proper. Thanks for flagging J, |
|
Hm I might commit again to this PR because I think #34 null issue is linked to ISaveBackupLocation inclusion. |
|
Cool, #34 is fine regardless as its a good safety check to have if the user randomly has no backup handler assigned. So I'm happy to have that either way xD As for this. I think I may sort a global link.xml file to sort this. Just reading up on it now, as it'd avoid having to place attributes in a load of places in most cases. |
|
Oh alright ^^ |
|
Changes are in for the next release: https://github.com/CarterGames/SaveManager/tree/release/3.0.6 |
|
Release now out, closing this PR as the link.xml bits are in there and should work.... |
When using
SaveManager.SaveGame(), this error can occur in runtime :It appears that with further research, the
LocationHandlerclass is null revealing that there is no save location set (even through there is.)Seems like Unity strips (if enabled in Project Settings) the
ISaveDataLocationclasses for some reason. This is fixed by adding the[Preserve]decoration fromUnityEngine.ScriptingI think it needs more testing because I couldn't reproduce this issue with Unity 6.4 (it's happening for my project in Unity 6.6 Alpha.)
If this true in any versions of Unity, it should be documented as well to avoid confusions.