public void DisplayQuest(Quest quest) { QuestUIContainer newQuestUIContainer = Instantiate(PrefabManager.instance.questUIContainer, containerParent).GetComponent <QuestUIContainer>(); questContainers.Add(newQuestUIContainer); newQuestUIContainer.titleTextBox.text = quest.name; newQuestUIContainer.mainTextBox.text = quest.instructions[0][quest.progressIndex]; //<-- wrong way around, right? progress index should be the first of those. but the first quest just doesn't need the second one? }
public void QuestAdd(Quest quest) { PlayerQuestController.Instance.inProgressQuests.Add(quest); QuestUIContainer emptyItem = Instantiate(questContainer, questScrollContent); emptyItem.transform.localPosition = new Vector3(1, 1, 1); emptyItem.SetQuest(quest); // emptyItem.transform.SetParent(scrollViewContent); questScrollContent.sizeDelta = new Vector2(questScrollContent.rect.width, questScrollContent.rect.height + questContainer.GetComponent <RectTransform>().rect.height); // height of container emptyItem.GetComponent <RectTransform>().localScale = new Vector3(1, 1, 1); }
void Start() { questContainer = Resources.Load <QuestUIContainer>("Prefabs/UI/Quest/Quest Container"); UIEventHandler.OnQuestAccepted += QuestAdd; questPanel.gameObject.SetActive(false); }