/// <summary> /// Reacts to a callback event CompleteQuestEventInfo; /// This then changes material for the indicator and proceeds to set the indicator to inactive; /// </summary> /// <param name="eventInfo">CompleteEventInfo;</param> private void QuestCompleted(EventInfo eventInfo) { GoalReachedEventInfo grei = (GoalReachedEventInfo)eventInfo; //CompleteQuestEventInfo grei = (CompleteQuestEventInfo)eventInfo; if (grei.completedQuestID == questID && enabled == true) { lampRenderer.material = completedQuest; } }
/// <summary> /// Reacts to a callback event caused by goalReachedEventInfo /// This changes the staus of the quest, marking it as complete if the goal is reached. This will make the quest turn in-able at the questgiver /// </summary> /// <param name="eventInfo"></param> private void ChangeStatusForQuests(EventInfo eventInfo) { GoalReachedEventInfo completed = (GoalReachedEventInfo)eventInfo; Quest completedQuest = null; if (questLog.ContainsKey(completed.completedQuestID)) { completedQuest = questLog[completed.completedQuestID]; completedQuests.Add(completed.completedQuestID); } if (completedQuest != null) { questLog.Remove(completed.completedQuestID); } }
/// <summary> /// Increases the quests progress by calling the quests goal and increasing its progress; /// if the goal is meet with the increase then the quest will send GoalReachedEventInfo callback; /// </summary> public void IncreaseQuestProgress() { if (activeStatus == true) { goal.increaseProgress(); } if (goal.IsGoalReached()) { GoalReachedEventInfo grei = new GoalReachedEventInfo { completedQuestID = questID }; //GoalReachedEventInfo grei = new GoalReachedEventInfo { completedQuestID = questID}; EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.QuestGoalReached, grei); // Debug.Log("Quest " + questID + " is completed"); } }