- Home /
Question by
raja-bala · Mar 23, 2015 at 10:06 AM ·
uieventsystemevents
Trigger UI element callback from script
Currently, my toggles and sliders trigger a callback only when the value changes. This duplicates my initialization logic, wherein I need to initialize the variables that are updated on the callbacks in addition to the UI elements themselves.
I'd like to do away with that, and simply attach a script to every UI element that has a OnValueChanged
callback option, which triggers the callback from Start
with the value.
How can I do this?
Comment