I was stuck at a similar problem recently. I had multiple buttons added via script and each of them should call a function with another parameter. There was a lot of trouble because everytime only the last button in the list called the function instead of the other one i really wanted to. So my trick was to add a short script (only with my listener and the variable) to each button Prefab. So if the buttons are created there is no Problem with the sharing of the listeners.
I hope i could save someone a little bit of time ^^
↧