Getting ready

This approach is very similar to the one used in the previous recipe. We must add a new member variable to our AgentBehaviour class. We should also refactor the Update function to incorporate priority as a parameter to the Agent class's SetSteering function. The new AgentBehaviour class should look something like this:

public class AgentBehaviour : MonoBehaviour 
{ 
    public int priority = 1; 
    // ... everything else stays the same 
    public virtual void Update () 
    { 
        agent.SetSteering(GetSteering(), priority); 
    } 
} 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.157.62