Hi folks,
Over the past couple of days I've been looking over the NGUI documentation, forum threads, video tutorials, and more trying to figure this out. I've come to the conclusion that I just need to ask because I can't find the answer anywhere else. (I'm not saying the answer isn't out there, just that I seem to be unable to find it!)
I would like to dynamically instantiate an unknown number of buttons at runtime that each correspond to an action or skill, depending on the character.
For example, if my Fighter class has 5 actions and my Mage class has 8 actions, then if I select a fighter character I'll want to instantiate 5 buttons, each one mapped to a different action. If I select a Mage character, then I'll want to instantiate 8 buttons, each one mapped to a different action.
The part I'm having trouble figuring out (though I'll gladly accept hints/tips/help with any of it) is how would I dynamically change the function that is called when the button is clicked? I mean, how do I dynamically map a button to a different skill/action?
Or am I thinking about this the wrong way?