Show Last Quest Details On Open?

Announcements, support questions, and discussion for Quest Machine.
Post Reply
jlhacode
Posts: 77
Joined: Fri Jul 03, 2020 6:23 am

Show Last Quest Details On Open?

Post by jlhacode »

Hi, I was wondering if there was a simple way to implement something similar to the Show First Quest Details On Open but showing the opposite instead.


Code: Select all

        protected virtual Quest GetFirstQuest()
        {
            var hasQuest = (questJournal != null && questJournal.questList != null && questJournal.questList.Count > 0);
            return hasQuest ? questJournal.questList[0] : null;
        }
I figured I would have to extend UnityUIQuestJournalUI and create a similar function to GetFirstQuest(). Simply enough, I replace the 0 in the questList array lookup with a questList.Count - 1 and call it in the override Show(QuestJournal) method.

The issue I'm running into is that I can't add my Quest Journal UI prefab to my QuestMachineConfiguration component for some reason. In fact, I can't remove and re-add the Quest Journal UI object even if I don't change the gameobject/prefab at all. This may be caused a hole in my understanding of Unity.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Show Last Quest Details On Open?

Post by Tony Li »

Please see page 46 of the Quest Machine manual. Because that field uses a C# interface, you have to drag the specific component into the field to assign it.
Post Reply