您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
26 行
744 B
26 行
744 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class OnClickURL : MonoBehaviour, IPointerEnterHandler, IPointerDownHandler, IPointerExitHandler
|
|
{
|
|
public string URL = "https://unity.com";
|
|
public Texture2D linkCursor;
|
|
public Vector2 hotSpotPosition = Vector2.zero;
|
|
|
|
public void OnPointerDown(PointerEventData eventData)
|
|
{
|
|
Application.OpenURL(URL);
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
Cursor.SetCursor(linkCursor, hotSpotPosition, CursorMode.Auto);
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
Cursor.SetCursor(null, Vector2.zero, CursorMode.ForceSoftware);
|
|
}
|
|
}
|