UnityEventVisualizer icon indicating copy to clipboard operation
UnityEventVisualizer copied to clipboard

Local graphs backtrack

Open MephestoKhaan opened this issue 5 years ago • 6 comments

Allow localgraphs to not only show events leaving the target, but arriving to it.

MephestoKhaan avatar Apr 06 '20 17:04 MephestoKhaan

Is this the concept of you can select a GameObject in the Unity hierarchy and for a component on there it will show what events are calling methods on that component?

I (think) it's not possible to start from that component and go upstream via code, but if you have a map of the downstream already then you can use that map to do that upstream lookup.

if this issue is related to the feature I outlined then that would be so useful! Because there's no real way of doing this in the Unity inspector.

You can start at a component and keep clicking on the event listeners to follow the flow downstream but you can't start on a component and see what event listeners are calling methods on that component.

thestonefox avatar Apr 14 '20 16:04 thestonefox

Correct! going upstream is the goal here. I do have the map, huge on VRTK for example but the "price" comes from painting it entirely really. So it should be achievable to do a search on what nodes are calling the selected GO.

MephestoKhaan avatar Apr 14 '20 16:04 MephestoKhaan

That would be so useful for VRTK. The amount of times i know where I end up but I wanna see how I got there

thestonefox avatar Apr 14 '20 17:04 thestonefox

Some progress!! https://gyazo.com/bf171458811555edb0935184c314874e

So, searching all events in the scene (28k events) take like 30 seconds, but you really need to do that "once" unless you change the hierarchy.

Then showing ALL events is pretty much impossible (and unusable) but searching in the cached set for the ones around (sending or receiving calls) is very fast. So you can traverse the tree up and down.

I will make it a bit more usable (adding the new boxes but not removing the old ones so it keeps thing in place) plus adding some more interesting menus and hopefully upload it next week or so

Not how the "random" colours of the edges kept unaltered

MephestoKhaan avatar Apr 19 '20 15:04 MephestoKhaan

Thinking about how to do this, probably the buttons will change to:

"Cache all events" <== mark as dirty when hierarchy changes, add a loader "Refresh" <=== updates for when changing maybe links but not necesarily the hierarchy (or play/stop) "Add self" <=== adds all events coming and going from the selected GO "Add hierarchy" <==== same as above but for the whole hierarchy (really needed?) "Remove node" <==== removes them from the graph

MephestoKhaan avatar Apr 20 '20 10:04 MephestoKhaan

Being able to jump back up through the possible events that called your method will be so useful for vrtk debugging!

thestonefox avatar Apr 20 '20 12:04 thestonefox