private void Start() { questsScreenController = GetComponentInParent <QuestsScreenController>(); questsScreenController.GetComponent <MainNavBarBackButtonEventToFSMEvent>().enabled = false; currentMascot = Service.Get <MascotService>().ActiveMascot; if (currentMascot == null) { string currentMascotID = questsScreenController.CurrentMascotID; if (!string.IsNullOrEmpty(currentMascotID)) { currentMascot = Service.Get <MascotService>().GetMascot(currentMascotID); } } currentChapter = questsScreenController.CurrentChapterData; if (currentMascot != null) { if (currentChapter.Number > 0) { LoadQuestsForMascot(currentMascot.Name, currentChapter.Number); return; } QuestDefinition nextAvailableQuest = currentMascot.GetNextAvailableQuest(); int chapterNumber = ((nextAvailableQuest != null) ? (nextAvailableQuest.ChapterNumber - 1) : currentMascot.Definition.ChapterData[currentMascot.Definition.ChapterData.Length - 1].Number); LoadQuestsForMascot(currentMascot.Name, chapterNumber); } }
private void OnDestroy() { for (int i = 0; i < currentMascot.KnownQuests.Length; i++) { Service.Get <NotificationBreadcrumbController>().RemovePersistentBreadcrumb(BreadcrumbType, currentMascot.KnownQuests[i].name); } Service.Get <NotificationBreadcrumbController>().RemoveBreadcrumb($"{currentMascot.AbbreviatedName}Quest"); questsScreenController.GetComponent <MainNavBarBackButtonEventToFSMEvent>().enabled = true; }