38 lines
825 B
C#
38 lines
825 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class StartButtonHint : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
|
{
|
|
[Header("UI 參照")]
|
|
[Tooltip("開始 Button")]
|
|
public Button targetButton;
|
|
|
|
[Tooltip("提示物件")]
|
|
public GameObject hintObject;
|
|
|
|
void Start()
|
|
{
|
|
if (hintObject != null)
|
|
{
|
|
hintObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
if (hintObject != null && targetButton != null && !targetButton.interactable)
|
|
{
|
|
hintObject.SetActive(true);
|
|
}
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
if (hintObject != null)
|
|
{
|
|
hintObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|