Graph editors are great for many things: state machines, shaders, animation transitions and visual scripting. These are universally usefull, but every project also has it’s own structures that ideally had a graph editor, be it tech trees, crafting systems, dialog data, level progression or custom state machines. The problem is: writing such editors takes a lot of effort.
The RelationsInspector (RI) editor window makes that dramatically easier. You can make a basic custom graph inspector by adding just two attributes to your code. You simply specify what’s unique about your usecase: the kind of object relation you want displayed. RI takes care of the rest… it builds a graph, finds a layout and lets you navigate and modify it. Think of it as writing a custom inspector for your graph viewer. While RI saves you all that effort, you stil have the option to customize it: node widget UI, context menus, toolbar and much more.
Use RI for the connections between objects and Unity’s inspector for the properties of single objects. Both together are a great match.
RI comes with an API, so your own tools can take full control over it. They can specify the data to display and the custom inspector to use and even modify the shown graph. If you develop an editor extension for the asset store, a custom graph inspector could be a great enhancement to your tool!
Last night the demo landed on the asset store. It comes with all features of the full version. Check it out!
Next up: more example use cases… I’m thinking a simple dialog system and maybe something with Unity’s new Playable API. That seems to lend itself nicely to node-based editing.
Thanks, I’m glad you like it. I’ll keep maintaining the demo along with the full version. That way, other tools can offer the RI as an optional view for their data, and their users get to evaluate it at no cost.
Right now there is a “featured” box around RI’s entry on the asset store. I haven’t yet figured out what that means, but I assume the store team likes the tool. So thanks for that!
The dialog system example is ready. In addition to the node-based editor, the dialog data also uses Unity events, so you can hook any code to your dialog buttons. Check it out.
Excellent plugin! Looking forward to updates. Quick question, I could not find a way to track a script across multiple scenes, it only seems to work for prefabs. Is this functionality possible, if not do you think this would be included in a future update :). Thanks.
Do you want to see all scenes that reference a certain script? That should work. Just drag the script file from the project window into the RelationsInspector window and use the asset reference backend. You’ll see the reference chains from your script into all the scenes that depend on it.
Hey, That was exactly what I was looking for. It was my fault, I did not see your first post and thought that these were missing from the build. Is there a reason for them being hosted on github, will they be included in future builds? Thanks again for creating this plugin, it works like a charm for large projects and makes project management incredibly easy and fun :).
Awesome
I didn’t include the asset reference backend in the package because of the two problems listed in its readme. People should be aware of them before they use it. Maybe I’ll include it in a future version and show a disclaimer dialog when you open it for the first time.
@seldom_1 I now understand why you did not include them.
It is scary when Unity does not respond for a while, is it possible to include progress bars?
Also it did not work in my project as it is a medium size project with several dependencies and each time I run the asset reference it crashes Unity.
I tried running it in a small test project with a couple of scenes and it worked fine (even then it took a long time and somehow it did not show me scene names, might be a bug). What I did was attach an SMAA script to the camera on two different scenes and then tried to find the dependencies of this script. Doing this it did find that camera object, however the scene names were shown as blank squares.
Hope you have a way to optimize the algorithm as this is a necessary feature and would help a lot with project management.
I told you they aren’t in the package for a reason
The asset reference backend has to load scene files. Those calls block the main thread, no chance for a progress bar. It’s the same as when you load a scene manually, the editor is unresponsive until that is done. It shouldn’t crash though… any chance you can share the project with me for debugging?
I’ll have a look at the scene name labels.
The main performance bottleneck for that backend is the scene loading, which I have no control over. I doubt it can get much faster. But even with its flaws, asset reference analysis is still my favourite application of RelationsInspector.
edit: The scene name label issue should be fixed now.
I believe you should look at collaborating with the authors of Maintainer (Maintainer - Community Showcases - Unity Discussions) and Asset Hunter (Asset Hunter (Project cleaning tool) - Community Showcases - Unity Discussions) as they seem to do similar searches across project scenes (although the latter is related more to scenes in the build). I have used Maintainer and it is fast and provides good results, the author is active and always open to suggestions (the same applies for the author of Asset Hunter). I think RelationsInspector can provide a very strong visual aid to these products.
Thanks for the quick update, the scene name labels are displayed correctly now :).
Do you do garbage collection or in some way monitor the memory involved in looking through the dependencies. I monitored my RAM while running the simple test described above (testing SMAA on cameras in two scenes). What I noticed was that the RAM it required to load the scenes and find the dependencies remained at that value even after the plugin had finished finding the assets and displaying them (For example the test above took approx 500 mb of RAM use and when the test finished that RAM was still being used and never freed, the high amount of RAM may have been due to one scene which is a bit heavy)
Interesting.
The garbage collector is not invoked explicitly, but all scene objects are destroyed after it was analyzed and before the next one is loaded. Maybe something leaks, I’ll do some memory profiling.
Edit: I’m traveling this week, so it’s going to be a few days until I have an update.
I just finished a new RelationsInspection backend!
It shows an overview of all UI event related data, lets you navigate to the involved objects and the listener’s source code file.
It looks like this:
In action:
@iamsam I did some profiling on the AssetReferenceBackend and got the same results as you. Sometimes Unity would release the memory after building the graph, sometimes it would keep it allocated. Now I’m enforcing garbage collection after scenes are unloaded and it looks better. As a precaution, the backend now also creates a fresh scene before doing anything (and lets the user save her active scene).