Question by
digitalmkt · Jun 25, 2019 at 08:03 PM ·
buttonarraybuttonsbutton trigger eventsopenurl
Dymanic buttons with different openURL links
I have dozens of url to be opened by buttons. The links I'm loading from firebaseDB and it's works fine. I'm trying this a approach:
public Button webLinkButt;
public void weblink(string link)
{
for (int x = 0; x < link.Length; x++)
{
Debug.Log("URL to link is: " + link); // here I can have the list of links assigned to each instanced sring.
webLinkButt.onClick.AddListener(() => TaskOnClick(link)); //seems not to be working
++x;
break;
}
}
public void TaskOnClick(string link){
Debug.Log("Open URL Activated to: " + link); // is empty...
Application.OpenURL(link);
}
I need help to to make each URL to be set in each button dynamically. The full description is here:
Comment