Beispiel #1
0
    void Start()
    {
        agent   = gameObject.GetComponentInChildren <CollectorAgent>();
        targets = gameObject.GetComponentsInChildren <BaseTarget>().ToList();
        goal    = gameObject.GetComponentInChildren <BaseGoal>();

        SetResourceRequirements();
        SetAgentTarget();
    }
Beispiel #2
0
    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);
    }
Beispiel #3
0
 public void SetUpGoal(BaseGoal goal)
 {
     this.goal = goal;
 }
 public GoalTracker(QuestTracker quest, BaseGoal goal)
 {
     this.quest = quest;
     this.goal  = goal;
 }
Beispiel #5
0
 public KillGoalTracker(QuestTracker quest, BaseGoal goal) : base(quest, goal)
 {
 }
Beispiel #6
0
 public CollectionGoalTracker(QuestTracker quest, BaseGoal goal) : base(quest, goal)
 {
     this.currentAmount = InventoryController.instance.GetItemCount(((CollectionGoal)goal).itemSlug);
 }