/// <summary> /// Gets the quests from the filename specified /// </summary> private void GetQuestsFromFile() { PlayerQuestArray quests = JsonArrayHandler <PlayerQuestArray> .ReadJsonFile(filePath); foreach (var quest in quests.items) { currentQuests.Add(quest); } questManager.InitQuestScriptableObjects(quests); }
public void ReadFile() { NPCStates npcFileStates = JsonArrayHandler <NPCStates> .ReadJsonFile(filePath); npcStates.Clear(); foreach (var npcState in npcFileStates.items) { npcStates.Add(npcState); } for (int i = 0; i < npcStates.Count; i++) { npcs[i].currentQuest = npcStates[i].questNumber; } }
public void InitDictionary() { PlayerItems playerItems = JsonArrayHandler <PlayerItems> .ReadJsonFile(Path.Combine(Application.persistentDataPath, "PlayerItems.json")); items.Clear(); foreach (PlayerItem item in playerItems.items) { GameObject go = new GameObject(); go.AddComponent <Item>(); Item gameObjectItem = go.GetComponent <Item>(); gameObjectItem.Name = item.item.name; gameObjectItem.Type = item.item.itemType; items.Add(gameObjectItem, item.amount); if (item.item.name.Equals("Trident")) { Weapons[1].gameObject.SetActive(true); } } }