12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- 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);
- }
-
- }
|