_xiaofang/xiaofang/Assets/Script/UI/ZZZZZZ/Choose.cs

39 lines
861 B
C#
Raw Normal View History

2024-12-17 16:28:38 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class Choose : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public bool isNoTip;
public bool isShow;
public GameObject Tip;
public void Start()
{
Transform childTransform = transform.Find("Choose_Bg/Choos_Tip");
Tip = childTransform.gameObject;
}
private void Update()
{
if (isShow&&isNoTip)
{
Tip.SetActive(true);
}
else
{
Tip.SetActive(false);
}
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
public void OnPointerEnter(PointerEventData eventData)
{
isShow = true;// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뿪ʱ
public void OnPointerExit(PointerEventData eventData)
{
isShow = false; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
}