August 2018
Beginner
334 pages
10h 19m
English
This is a recipe that requires experience of graph building, so it is based on the general Graph class. That means that we will need to use a specific graph definition (no matter which one you prefer), or define our own methods to handle vertices and the neighbors' retrieval logic, as learned in Chapter 2, Navigation.
We will learn how to implement the specific algorithms for this recipe, which are based on top of the Graph class general functions and the Vertex class.
Finally, we will need a base Unity component for our agent and Faction enum.
The following is the code for the Faction enum and Unit classes. They can be written in the same file, which is called Unit.cs:
using UnityEngine; using System.Collections; public enum ...
Read now
Unlock full access