public void LoadFromFile(JSONNode jsonObject) { var textJsonObj = jsonObject["text"]; bool isLastDialogueFinished = textJsonObj["isLastDialogueFinished"]; //prepare finished msg var jsonDialogueLengthInfo = textJsonObj["dialogueLengthInfo"]; var jsonDialogueMessages = textJsonObj["dialogueMessages"]; var _msgContent = new List <MessageContent>(); foreach (var jsonMsg in jsonDialogueMessages.Values) { var msg = new MessageContent(); Enum.TryParse <MessageBubbleType>(jsonMsg["messageType"], out msg.messageType); msg.content = jsonMsg["content"]; msg.shootTime = new SerializeManager.JsonDateTime(Convert.ToInt64((string)jsonMsg["shootTime"])); if (jsonMsg["fileBubbleName"] != null) { msg.fileBubbleName = jsonMsg["fileBubbleName"]; } if (jsonMsg["fileContentName"] != null) { msg.fileContentName = jsonMsg["fileContentName"]; } _msgContent.Add(msg); } var _msgLengthInfo = new List <int>(); foreach (var length in jsonDialogueLengthInfo.Values) { _msgLengthInfo.Add(length); } MessageContent[][] arrayInfo = SerializeManager.Deserialize2DArray(_msgLengthInfo, _msgContent); if (Services.saveManager.inkJson != "") { currentStory.state.LoadJson(Services.saveManager.inkJson); } //get the info from the save file foreach (var msgArray in arrayInfo) { _dialogueMessages.Add(msgArray); } if (!isLastDialogueFinished) { if (_dialogueMessages.Count > 0) { var leftDialogue = _dialogueMessages[_dialogueMessages.Count - 1]; _currentDialogueMessages = leftDialogue.ToList(); _dialogueMessages.Remove(_dialogueMessages[_dialogueMessages.Count - 1]); } } if (textJsonObj["lastTimeStamp"] != null) { _lastTimeStamp = new SerializeManager.JsonDateTime(Convert.ToInt64((string)textJsonObj["lastTimeStamp"])); } //recreate dialogues _LoadInitialDialogue(); _LoadMoreDialogue(); _LoadCurrentPlotMessageDuringPlayerOffTime(); }