Beispiel #1
0
    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?
    }
Beispiel #2
0
    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);
    }
Beispiel #3
0
 void Start()
 {
     questContainer = Resources.Load <QuestUIContainer>("Prefabs/UI/Quest/Quest Container");
     UIEventHandler.OnQuestAccepted += QuestAdd;
     questPanel.gameObject.SetActive(false);
 }