I’ve been struggling with my AR project in Unity. The main problem is the button opens the link repeatedly and it won’t stop. The concept I want to reach here is when I scanned a marker, a description text will pop up along with the button, the button will take user to a URL. The code I’m using is
public Transform ButtonMap;
TextObjectName.GetComponent().text=name;
if (name == “QRCode1”){
ButtonMap.GetComponent.().onClick.AddListener(delegate {Application.OpenURL(“https://www.google.com”); });
}
if (name == “QRCode2”){
ButtonMap.GetComponent.().onClick.AddListener(delegate {Application.OpenURL(“https://www.facebook.com”); });
}