Files
tianrunCRM/Assets/CoolapeFrame/3rd/NGUI_Enhance/Examples/Scripts/Other/OpenURLOnClick.cs

16 lines
289 B
C#
Raw Normal View History

2020-07-04 14:41:25 +08:00
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)) Application.OpenURL(url);
}
}
}