Support => NGUI 3 Support => Topic started by: eormo on March 28, 2016, 11:46:36 AM
Title: Onclick URL to a sprite in a scrollview
Post by: eormo on March 28, 2016, 11:46:36 AM
Hi,
I have a UI2D sprite in my scrollview that needs to open an URL once triggered with an onclick. Below is the code I generally use but it doesn't seemed to work with NGUI :
usingUnityEngine;
usingSystem.Collections;
publicclass URL : MonoBehaviour {
void OnMouseDown (){
Application.OpenURL("http://mywebsite.com");
}
}
I've found another topic about this issue on the forum but the solution provided did not work for me...
Thanks for reading!
EDIT : I got it working through the UIButton component :)
Title: Re: Onclick URL to a sprite in a scrollview
Post by: ArenMook on March 31, 2016, 04:02:38 AM
OnMouseDown is a Unity event. NGUI's equivalent is OnPress(bool isPressed), or OnClick().