Files
YGOProUnity_V2/Assets/NGUI/Examples/Scripts/Other/OpenURLOnClick.cs
T
lllyasviel 72f9f431f4 first
2017-05-14 16:15:52 +08:00

18 lines
291 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)) Application.OpenURL(url);
}
}
}