// Start is called before the first frame update private void Awake() { SetGoals(); if (goalTracker == null) { goalTracker = this.gameObject.GetComponent <GoalTracker>(); } }
public QuestTracker(Quest quest, QuestState state) { this.quest = quest; this.state = state; // Create the goal Trackers goalTrackers = new List <GoalTracker>(); GoalTrackerFactory factory = new GoalTrackerFactory(); foreach (BaseGoal goal in this.quest.goals) { GoalTracker goalTracker = factory.GetGoalTracker(goal, this); goalTrackers.Add(goalTracker); goalTracker.StartTracking(); } }