void Start() { agent = gameObject.GetComponentInChildren <CollectorAgent>(); targets = gameObject.GetComponentsInChildren <BaseTarget>().ToList(); goal = gameObject.GetComponentInChildren <BaseGoal>(); SetResourceRequirements(); SetAgentTarget(); }
public GoalTracker GetGoalTracker(BaseGoal goal, QuestTracker quest) { Type goalType = goal.GetType(); Debug.Log(goalType); if (goalType == typeof(CollectionGoal)) { Debug.Log("Creating a CollectionGoalTracker"); return(new CollectionGoalTracker(quest, goal)); } else if (goalType == typeof(KillGoal)) { Debug.Log("Creating a KillGoalTracker"); return(new KillGoalTracker(quest, goal)); } return(null); }
public void SetUpGoal(BaseGoal goal) { this.goal = goal; }
public GoalTracker(QuestTracker quest, BaseGoal goal) { this.quest = quest; this.goal = goal; }
public KillGoalTracker(QuestTracker quest, BaseGoal goal) : base(quest, goal) { }
public CollectionGoalTracker(QuestTracker quest, BaseGoal goal) : base(quest, goal) { this.currentAmount = InventoryController.instance.GetItemCount(((CollectionGoal)goal).itemSlug); }