protected virtual void Load(Dictionary <string, StratusStory> stories) { if (StratusStorySaveSystem.Exists(saveFileName, saveFolder)) { storySave = StratusStorySaveSystem.instance.Load(saveFileName, saveFolder); // From list to dictionary! foreach (var story in storySave.stories) { if (debug) { StratusDebug.Log($"Loaded {story.name}"); } stories.Add(story.name, story); } //if (debug) // Trace.Script("Loaded!"); } }
protected virtual void Save(Dictionary <string, StratusStory> stories) { // From dictionary to list List <StratusStory> storyList = new List <StratusStory>(); foreach (var story in stories) { storyList.Add(story.Value); } storySave.stories = storyList; // Now save it StratusStorySaveSystem.instance.Save(storySave); if (debug) { StratusDebug.Log($"Saved {StratusStorySaveSystem.ComposePath(saveFileName, saveFolder)}"); } }