ND_SimulationAutomaticControl/Assets/Scripts/ButtonHoverShowImage.cs

42 lines
850 B
C#
Raw Blame History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class ButtonHoverShowImage : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
[Header("報炎傅唯<E58285>幣議夕頭")]
public GameObject hoverImage;
void Start()
{
if (hoverImage != null)
{
hoverImage.SetActive(false); // 兜兵咨茄
}
}
/// <summary>
/// 報炎卞秘
/// </summary>
public void OnPointerEnter(PointerEventData eventData)
{
if (hoverImage != null)
{
hoverImage.SetActive(true);
}
}
/// <summary>
/// 報炎卞竃
/// </summary>
public void OnPointerExit(PointerEventData eventData)
{
if (hoverImage != null)
{
hoverImage.SetActive(false);
}
}
}