public void WriteFile() { for (int i = 0; i < npcs.Count; i++) { npcStates[i].questNumber = npcs[i].currentQuest; } JsonArrayHandler <NPCState> .WriteJsonFile(filePath, npcStates); }
public void Save() { //Update the quest states from the scriptable objects for (int i = 0; i < questManager.GetQuests().Count; i++) { currentQuests[i].questState = questManager.GetQuests()[i].questData.questState; } JsonArrayHandler <PlayerQuestData> .WriteJsonFile(filePath, currentQuests); }
public void Save() { List <PlayerItem> playerItems = new List <PlayerItem>(); foreach (var itemObj in items) { Debug.Log(itemObj); PlayerItem playerItem = new PlayerItem(itemObj.Key.Name, itemObj.Key.Type, itemObj.Value); playerItems.Add(playerItem); } JsonArrayHandler <PlayerItem> .WriteJsonFile(Path.Combine(Application.persistentDataPath, "PlayerItems.json"), playerItems); }