12345678910111213141516171819202122232425262728 |
- using UnityEngine;
- using UnityEngine.EventSystems;
- using UnityEngine.UI;
- /// <summary>
- /// 鼠标进出图片切换
- /// </summary>
- public class EnterExitImageChange : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
- {
- public Sprite PointerEnterSprite;
- public Sprite PointerExitSprite;
- public Image mImage;
- public void OnPointerEnter(PointerEventData eventData)
- {
- mImage.sprite = PointerEnterSprite;
- }
- public void OnPointerExit(PointerEventData eventData)
- {
- mImage.sprite = PointerExitSprite;
- }
- public void BtnClickExecute()
- {
- mImage.sprite = PointerExitSprite;
- }
- }
|