using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class ZiYuanFileItem : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler { public Button button; public GameObject enterImage; public GameObject blueImage; public GameObject grayImage; public Text nametext; // Start is called before the first frame update void Start() { button.onClick.AddListener(ValueChange); } private void CanelLoad() { blueImage.SetActive(false); grayImage.SetActive(false); } private void ShowOrHideGray(int num) { if (!blueImage.activeSelf) { if (num >= 3) { grayImage.SetActive(true); } else { grayImage.SetActive(false); } } } private void ValueChange() { if (!blueImage.activeSelf) { blueImage.SetActive(true); UIModelManager.Instance.loadModelName = nametext.text; } else { blueImage.SetActive(false); UIModelManager.Instance.loadModelName = ""; } } public void OnPointerEnter(PointerEventData eventData) { if (blueImage.activeSelf || grayImage.activeSelf) { return; } this.enterImage.SetActive(true); } public void OnPointerExit(PointerEventData eventData) { if (blueImage.activeSelf || grayImage.activeSelf) { return; } this.enterImage.SetActive(false); } }