private void TurnInQuest() { lampRenderer.material = standardMaterial; if (turnedIn != true) { CompleteQuestEventInfo cqei = new CompleteQuestEventInfo { eventQuestID = questID }; EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.CompleteQuest, cqei); RewardQuestInfo rei = new RewardQuestInfo { rewardNumber = myQuest.RewardID }; EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.QuestReward, rei); EventHandeler.Current.UnregisterListener(EventHandeler.EVENT_TYPE.QuestGoalReached, QuestCompleted); EventHandeler.Current.UnregisterListener(EventHandeler.EVENT_TYPE.AvailableQuest, MakeQuestAvalible); } else if (nextQuestInLine != null && turnedIn == true) { nextQuestInLine.enabled = true; //Debug.Log("Im do the nexInLine DoMe()"); nextQuestInLine.ControllInput(); } turnedIn = true; }
/// <summary> /// Called when the QuestComponent is reacting to a callback event that completes a quest; /// Removes the quest from the questLog and adds the questID to completedQuests; /// </summary> /// <param name="eventInfo">CompleteQuestEventInfo;</param> private static void CompleteQuest(EventInfo eventInfo) { CompleteQuestEventInfo completed = (CompleteQuestEventInfo)eventInfo; AvailableQuestEventInfo aqei = new AvailableQuestEventInfo { }; EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.AvailableQuest, aqei); }
private void RemoveDoor(EventInfo eventInfo) { CompleteQuestEventInfo cqei = (CompleteQuestEventInfo)eventInfo; if (cqei.eventQuestID == requiredQuestID) { gameObject.SetActive(false); } }
/// <summary> /// Reacts to a CompleteQuestEventInfo callback; /// This uppdates the UI questLog so no old information is displayed; /// </summary> /// <param name="eventInfo">CompleteQuestEventInfo</param> private void CompleteQuest(EventInfo eventInfo) { CompleteQuestEventInfo cqei = (CompleteQuestEventInfo)eventInfo; questIndex.Remove(cqei.eventQuestID); }