- Home /
[4.6 UI] Possible to reference parameter of OnClick persistent event?
In the Button component I have a function under OnClick() with a parameter. I'd like to, through code, be able to access the value of the parameter for a function in that list (ideally by index) at run time. Is this possible? I see that I can get the object that the event points to and the method name.
Comment
I might be wrong but the method you pass to the OnClick contains a parameter in the signature. This is what you can use anywhere in the script.
Type member;
public void $$anonymous$$y$$anonymous$$eth(Type myParam)
{
member = myParam;
}
private void Other$$anonymous$$eth()
{
list[member].Invoke();
}
@fafase You've been watching too much Breaking Bad. I don't think you get the question, but that's dependent on what "list" is.