1234567891011121314151617181920212223242526272829303132333435363738 |
- 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<ToggleShowBtnTip>, 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);
- }
- }
- }
|