I had a hard time finding information on how to create a
custom inspector in the unity editor, so I’m going to start by sharing a few
links that helped me a lot.
First of all, Unity has a bit of documentation on the editor and how to extend it. Those two links are full of useful information and should definitely be read.
However, for my project, I wanted to be able to add a button to my inspector and wasn't able to gather enough information from Unity's documentation to do so. I figured out how to do this by reading this great article which explained quite a few ways to use and customise the editor.
Once you know what to do, creating a custom editor is quite simple really. Below is the script I used to override my pathfinder inspector. Hopefully the comments should explain everything that needs explaining.
My pathfinder inspector now shows a button which links all waypoints together in editor mode, allowing the user to check the path coverage without having to run the application.


No comments:
Post a Comment