I am trying to listen to a “wire event”, meaning that each time a wire is either connected or disconnected on the canvas, I want to have a little script running.
I found some great material here, posted by @LongNguyen, where the event is triggered each time the source of any component in the canvas changes:
However, his code has a couple of issues that I can’t figure out how to solve:
It actually does not work with all the components, I tested it against a bunch and in my case it only worked with the containers components. What can I do to make it work for all?
The cache seems to be handled badly. If I change my script within the event, the changes do not apply to the components that are already placed on the canvas. However if I generate a new container component, the changes will be taken into account.
This problem is kind of secondary though, as I think I won’t change my script once I solve problem number 1
Hope all this was clear enough…
Looking forward to your answers