How it works...

We create a custom editor window and set up the OnScene delegate function for handling events on the scene window. Also, we are capable of creating the graph nodes by traversing the mesh vertex arrays, computing each triangle's centroid. Finally, we make use of the graph's LoadGraph function in order to compute neighbors.

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.