Next, let's take a look at the Aspect.cs class. Aspect is a very simple class with just one public property, called aspectName. That's all the variables we need in this chapter. Whenever our AI character senses something, we'll check this against the aspectName to see if it's the aspect that the AI has been looking for.
The code in the Aspect.cs file is as follows:
using UnityEngine; public class Aspect : MonoBehaviour { public enum aspect { Player, Enemy } public aspect aspectName; }
Attach this aspect script to our player tank and set the aspectName property as Enemy: