Hi.
I want to create a button which opens a link to a new webpage. Currently I use the following inside of a OnMouseDown
method:
Application.ExternalEval("window.open('" + url + "','_blank')");
However this gets rightfully blocked by any popup blocker. I’ve done some research and found out, that the blocker only allows this when the funktion was called by a user event like the onclick event.
Outside of unity you could use the events like this (in a form class):
private Button someButton;
private EventHandler buttonEvent;
//inside of the constructor:
buttonEvent = new EventHandler(buttonFunktion);
someButton = new Button();
someButton.Click += newFormEvent;
private void buttonFunktion(object o, eventArgs e){}
My problem is that I have no idea how I could access the events which get fired when I press a mouse button over a collider.