예제 #1
0
    public void FollowerReturnToBase(int idx, List <ResourceType> resourceToCarry)
    {
        var agent = agents[idx];

        agent.transform.parent = idleContainer;
        idle.Add(agent);

        agents.RemoveAt(idx);
        agent.target = boat.position;
        agent.combat = false;

        foreach (var res in resourceToCarry)
        {
            agent.AddResource(res);
        }

        camp.ProcessPile(agent.pile);

        if (agents.Count == 0)
        {
            foreach (Follower f in idle)
            {
                f.speed = 2.5f * player.speed;
            }
        }
    }