TextureCombiner/Assets/Scripts/UI/OpenURL.cs
max 1165a4e4a8 Init.
P4 -> GitHub sync.
2020-11-01 03:54:32 +01:00

24 lines
470 B
C#

using UnityEngine;
using UnityEngine.EventSystems;
namespace TextureCombiner
{
public class OpenURL : MonoBehaviour, IPointerClickHandler
{
[SerializeField]
private string m_url = "";
[SerializeField]
private bool m_httpsOnly = true;
public void OnPointerClick(UnityEngine.EventSystems.PointerEventData eventData)
{
if(m_httpsOnly && !m_url.StartsWith("https://"))
{
m_url = "https://" + m_url;
}
Application.OpenURL(m_url);
}
}
}