
Simply put, what I need is to create a custom class. Then edit the four states, each of which are using my custom class.

This aiAgent.cs script can be regarded as the core of the ai system.

Take this attack state as an example, it is not a script inherited from MonoBehaviour but inherited from aiState.
Below I will introduce the settings of the unity editor interface.


First select the area where the ai can act and the size of the ai under the Navigation tab. After completing the settings, the active area of ai can be baked.

The light blue area is the range of activity of the baked ai.
As I said before, I will only briefly discuss the code part of the ai system in the blog.
When I was developing the code part of the ai system, Anqing Sun had already sent me the design of the ai enemy.

After my friendly communication with Anqing Sun, the types of AI enemies have been reduced from 7 in the picture to 3 in the red box.