I’m planning to use Unity’s built-in Navigation and I was wondering where should I put my navigation functions. Should it be in the IEnumerator or Update? An example for the functions would be the basic movement and a few behaviors like idle and attack. (Just an example! It might change depending on what I go through.)
Personally, I believe IEnumerator is best for this scenario. As you can start and stop an IEnumerator at any time rather than disabling an entire script or using a boolean to disable it. Additionally, some functionality in a IEnumerator is fairly helpful ‘yield return new waitforseconds’ is a perfect example.