Project_WL/Assets/ThirdParty/NGUI/Examples/Scripts/Other/OpenURLOnClick.cs

16 lines
298 B
C#

using UnityEngine;
public class OpenURLOnClick : MonoBehaviour
{
void OnClick ()
{
UILabel lbl = GetComponent<UILabel>();
if (lbl != null)
{
string url = lbl.GetUrlAtPosition(UICamera.lastWorldPosition);
if (!string.IsNullOrEmpty(url)) WebViewInfo.Ins.Show_WebView(url);
}
}
}