inkle / ink-unity-integration

Unity integration for the open source ink narrative scripting language.
http://www.inklestudios.com/ink
Other
570 stars 99 forks source link

Exception: ink save format incorrect, can't load. #153

Closed RuslanGilyazev closed 3 years ago

RuslanGilyazev commented 3 years ago

Hi, good project, but the current serialization system is broken.

For example, the following lines use a different key for checking the version: https://github.com/inkle/ink-unity-integration/blob/01654c63626a0cea4ec1c950930b6a044a0a061f/Packages/Ink/InkLibs/InkRuntime/Story.cs#L254

https://github.com/inkle/ink-unity-integration/blob/01654c63626a0cea4ec1c950930b6a044a0a061f/Packages/Ink/InkLibs/InkRuntime/StoryState.cs#L592

I try to make save/load by call the following functions:

currentStory.ToJson();
currentStory.state.LoadJson(loadJson)
RuslanGilyazev commented 3 years ago

Sorry, it's my stupid mistake, I should use currentStory.state.ToJson()