public void FoldoutQuestInfo() { if (isDropdownFolded) { Quest quest = status.GetQuest(); foreach (var objective in quest.GetObjectives()) { GameObject prefab = incompletePrefab; if (status.IsObjectiveComplete(objective)) { prefab = objectivePrefab; } GameObject objectiveInstance = Instantiate(prefab, objectiveContainer); TextMeshProUGUI objectiveText = objectiveInstance.GetComponentInChildren <TextMeshProUGUI>(); objectiveText.text = objective; objectiveText.fontSize = 24; } } else { foreach (Transform item in objectiveContainer) { Destroy(item.gameObject); } } RotateDropdownIcon(); }
public void Setup(QuestStatus status) { Quest quest = status.GetQuest(); title.text = quest.GetTitle(); foreach (var obj in quest.GetObjectives()) { GameObject objectivePrefab = status.IsObjectiveComplete(obj.reference) ? this.objectivePrefab : objectiveIncompletePrefab; GameObject currentObjectivePrefab = Instantiate(objectivePrefab, objectiveContainer); currentObjectivePrefab.GetComponentInChildren <TextMeshProUGUI>().text = obj.description; } rewardText.text = GetRewardText(quest); }
public void Setup(QuestStatus status) { Quest quest = status.GetQuest(); title.text = quest.GetTitle(); objectiveContainer.DetachChildren(); foreach (string objective in quest.GetObjectives()) { GameObject prefab = objectiveIncompletePrefab; if (status.IsObjectiveComplete(objective)) { prefab = objectivePrefab; } GameObject objectiveInstance = Instantiate(prefab, objectiveContainer); TextMeshProUGUI objectiveText = objectiveInstance.GetComponentInChildren <TextMeshProUGUI>(); objectiveText.text = objective; } }
public void Setup(QuestStatus status) { Quest quest = status.GetQuest(); title.text = quest.GetTitle(); ClearObjectives(); foreach (var objective in quest.GetObjectives()) { GameObject prefab = objectiveIncompletePrefab; if (status.IsObjectiveComplete(objective.reference)) { prefab = objectivePrefab; } GameObject objectiveInstance = Instantiate(prefab, objectiveContainer); TextMeshProUGUI objectiveText = objectiveInstance.GetComponentInChildren <TextMeshProUGUI>(); objectiveText.text = objective.description; } rewards.text = GetRewardText(quest); }
public void Setup(QuestStatus status) { Quest quest = status.GetQuest(); // clear objective container foreach (Transform child in objectiveContainer) { Destroy(child.gameObject); } title.text = quest.Title(); // fill objective container from quest foreach (Quest.Objective objective in quest.Objectives()) { QuestObjective questObjectiveInstance = Instantiate(questObjectivePrefab, objectiveContainer); questObjectiveInstance.Setup(objective.description, status.IsObjectiveComplete(objective.reference)); } reward.text = GetRewardText(quest); }
public void Setup(QuestStatus status) { Quest quest = status.GetQuest(); title.text = quest.GetTitle(); foreach (Transform item in objectiveContainer) { Destroy(item.gameObject); } foreach (var objective in quest.GetObjectives()) { GameObject prefab = objectiveIncompletePrefab; if (status.IsObjectiveComplete(objective)) { prefab = objectivePrefab; } GameObject objectiveInstance = Instantiate(prefab, objectiveContainer); objectiveInstance.GetComponentInChildren <TextMeshProUGUI>().text = objective; } rewardText.text = GetRewardText(quest); }