private void Update() { if (QuestGoalFinished(currentQuestGoal)) { currentQuestGoal.OnFinish(); QuestGoals.RemoveAt(QuestGoals.IndexOf(currentQuestGoal)); } if (QuestGoals.Count != 0) { currentQuestGoal = QuestGoals[0]; } if (QuestFinished()) { PlayerStats.Singleton.AddEXP(EXP); StartCoroutine(UIManager.Singleton.ShowQuestEndScreen(Name)); PlayerQuestsManager.Singleton.availableQuests.RemoveAt(PlayerQuestsManager.Singleton.availableQuests.IndexOf(this)); Destroy(this.transform.parent.gameObject); } }
public bool QuestGoalFinished(QuestGoal goal) { return(goal.Finished()); }