public virtual void CompleteQuest()
    {
        //if a quest info box already exists, destory it
        if (FindObjectOfType <QuestInfoBox>())
        {
            Destroy(FindObjectOfType <QuestInfoBox>().gameObject);
        }

        QuestInfoBox q = Instantiate(questInfoBox.gameObject, null).GetComponent <QuestInfoBox>();

        q.SetText(questCompleteText);

        complete = true;

        completeEvent.Raise();
        OnQuestComplete.Invoke();
    }
示例#2
0
    public void AddProgress()
    {
        progress++;

        questProgressText = _orignalProgressText + " - (" + progress.ToString() + "/" + totalSteps.ToString() + ")";

        //if a quest info box already exists, destory it
        if (FindObjectOfType <QuestInfoBox>())
        {
            Destroy(FindObjectOfType <QuestInfoBox>().gameObject);
        }

        QuestInfoBox q = Instantiate(questInfoBox.gameObject, null).GetComponent <QuestInfoBox>();

        q.SetText(questProgressText);

        UpdateQuest();
        CheckForComplete();
    }