How it works...

The Attack and Enemy classes control the behaviors when needed, so the Enemy class can be called from another component in the game object. The FightingCircle class is very similar to FormationPattern, in that it computes the target positions for a given enemy. It just does it in a slightly different way. Finally, the StageManager grants all the necessary permissions for assigning and releasing enemy and attack slots for each circle.

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.