Visual Graph Documentation
The main idea of this graph, that only thing you do - is building your game as you want using this events system, and as bonus you get visualization of how your game works. And also it can work like debugging tool, with should show you where you have overloaded or forgotten listeners, or memory leaking. Here is how event graph looks for a simple example scene.
There is search field in the top left corner of Graph window. So that how our graph will look if we will search “Controller”
During graph construction, the elements are placed to avoid overlapping. Sometimes this is not the way you want to see your grap. That’s why it support position recording, if you move element via mouse, it position will be remembered. and in the next time it will be placed where you want it to be.
If you have a lot of small listeners or dispatchers in you event graph, collapsin can make it more readable. Collapsin has three modes:
1) Nothing - collapsing not working.
2) Listeners - equal(same class, same listen functions) listeners will collapse in one.
3) All Matches - equal listeners and dispatchers will be collapse in one.
Here is how our example graph will look like, if we will choose All Matches collapse mode.
In the example scene you can see three separate event branches. But in real project usually much more event brunches. That’s why you can view them separately from each other.
Use Branch list to switch view to any branch or switch back to view all of them. Or you can just use “Next Brunch” button.
Element Context menu:
Right click on graph element to open context menu
- Show in Editor - Open’s element class in your default unity code editor. Supports Script Inspector2.
- Show in Hierarchy. - If element class is MonoBehavior, this function will select gameobject which it’s attached to in scene hierarchy .
- Select Event Tree - The branch of this element will be selected.