using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using XRTool.UI; using UnityEngine.UI; using XRTool.Util; public class ToggleShowBtnTip : UnitySingleton, IPointerEnterHandler, IPointerExitHandler { public GameObject BtnTip; public Text BtnTiptext; public ToggleButton toggleButton; public void OnPointerEnter(PointerEventData eventData) { if (BtnTip && toggleButton && BtnTiptext != null) { BtnTip.gameObject.SetActive(true); if (!toggleButton.isOn) { BtnTiptext.text = "缩放"; } else { BtnTiptext.text = "拉伸"; } } } public void OnPointerExit(PointerEventData eventData) { if (BtnTip && toggleButton) { BtnTip.gameObject.SetActive(false); } } }