O'Reilly logo
  • Joseph Simpson thinks this is interesting:

// we need to limit the orientation values // to be in the range (0 – 360)

From

Cover of Unity 5.x Game AI Programming Cookbook

Note

Why not use Clamp here?

Oh, I see. This adds or removed 360. This is to account for what happens when the agent is rotated more than 360.