Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Raymond |
I have buttons generated via a script, and I want a method with parameters to be able to subscribe and unsubscribe to/from those buttons’ “Pressed”-events. Or in other words, how can I send additional arguments with a “Pressed”-event?
Something like this:
Button.Pressed += DoSomething;
public void DoSomething(string text)
{
// Do something with the text
}
That code obviously doesn’t work, so how could I implement that kind of behavior in C#?