IPointerEnterHandler, IPointerExitHandler
鼠标进入,移出事件,闪烁问题
新建一个UIImage,挂载下面的这个脚本
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems;//IPointerEnterHandler, IPointerExitHandler public class UI_MouseEnter : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler { public void OnPointerEnter(PointerEventData eventData) { Debug.Log("Hello"); transform.localScale = new Vector3(0,0,0); } public void OnPointerExit(PointerEventData eventData) { Debug.Log("Bye"); transform.localScale = new Vector3(1, 1, 1); } }直接改变 UI 按钮的localScale,就会出现闪烁的BUG
相关文章:
1.
[Unity][UGUI]Tooltip提示框
2.
3.