- Sometimes you want to bind a button dynamically.
- Or you may want to pass a parameter to the target function
- Or just add code to a button.
A handy script allowing you to bind a button to a message dynamically. By default the message is delivered to the named object, this can be customised for delivering to children or ancestors. If no object name is specified, delivery uses the button object as a starting point (useful to implicitly deliver upwards to a 'panel controller')
Variants show how to load a numbered level upon clicking a button: Also check this Q&A for how to remove listeners and more.
No comments:
Post a Comment