using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; //============================================================ //支持中文,文件使用UTF-8编码 //@author #AUTHOR# //@create #CREATEDATE# //@company #COMPANY# // //@description: //============================================================ public class BottomTips : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler { [HideInInspector] public Text tips; [HideInInspector] public GameObject tipsContent; [HideInInspector] public Toggle selfToggle; private void Start() { selfToggle = GetComponent(); tipsContent = transform.Find("Tips").gameObject; tips = tipsContent.transform.GetChild(0).GetComponent(); tipsContent.SetActive(false); } public void OnPointerEnter(PointerEventData eventData) { tips.text = gameObject.name; tipsContent.SetActive(true); } public void OnPointerExit(PointerEventData eventData) { tipsContent.SetActive(false); } }