Runtime added onClick events won´t show in editor
Hi, i´m adding some buttons in some UI in runtime. I know how to do that and it´s actually working, despite that i still don´t see the events showing in the editor, thing that makes my debugging definitely harder to be done.
Is it a Unity editor bug or am i missing something somewhere? I tried to google, but i couldn´t find any hint about this problem.
P.S Unity 5.4.1 at the moment. Thanks!
Without script you will not get any answers that can really help. You need to post both files involved. If the files are too big to be posted you can use a service like Pasetebin.com to add the files and then post the links here.
Thanks, i know i should post the code, but it´s really not a code related question. I debugged the buttons, the listeners are actually added with my code, so there´s actually no problem on that side. I just wanted a hint on how show them in the editor, as the debug would be really easy. As the answer down here suggests, unluckily it´s probably an expected and completely normal behaviour.
Answer by hexagonius · Nov 10, 2016 at 07:54 PM
Only editor scripts are capable of adding persistent listeners (not removed after play ends). It's expected Behaviour to not see those added at runtime. but it's probably possible by enabling the debug inspector mode through the tiny menu icon next to a gameobjects name in the inspector, but I'm not sure about that one.
Thanks for the reply. Unluckily the debug doesn´t change this at all. You might be right on the expected Behaviour assumption, even because that function is actually a editor script reading files and showing possible public delegate methods to link to the listener. So probably supposed to work only in editor. That´s actually a shame anyways.
I´ll leave the question open for a couple of days more just to see if someone else found a workaround or whatever, then i´ll accept this one. Thanks :)