Suppose I have a Controller class to sort a datalist:
public enum SortType {t1,t2...t20}
public Class Controller {
public void sort(SortType t);
}
then I have 20 buttons to call sort.
It would be convenient by using UIButton inspector to set callback function and param,
but when I select sort method, the appeared arg0 turn to type of Object.
So what would be the best practice to use UIButon for this case?
I know I could attach a script for each button, but it still need extra code:
class SortButton : Monobehavior {
public SortType type;
public Controller controller;
void OnClick() {controller.sort(type)}
}