I’m pretty new to Unity scripting so sorry if there’s gonna be smth. stupid and potentially obvious in my question.
So , to cut the long story short : is there a way to fetch child elements’ event and use it in it’s parent ? Say i’ve got a button with the main logic script attached to it and several child gui elements ( buttons or whatever it is) , so how do i connect OnMouseDown() call of those child elements.
Ideally i’d want to have some kind of signal/slot behaviour between parent/child objects , but maybe there’s some other way available in unity.
That’s called event bubbling. eDriven.Gui has it implemented. It also has signals and slots (as one of the 2 event mechanisms).
You could of course implement your own event bubbling machanism, but that would also include the event propagation mechanism in place.
Signals and slots are (just my experience) not very suitable for event bubbling. Simply because they doesn’t involve the instance of an object walking from child to a parent.