using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class PipelineShow : MonoBehaviour, IPointerClickHandler { public GameObject pipeline; // 管道 public Image backImage; // 背景图片 void Update() { } public void OnPointerClick(PointerEventData eventData) { pipeline.SetActive(!pipeline.activeSelf); if (pipeline.activeSelf) { backImage.color = new Color(0, 0.8f, 0, 0.5f); } else { backImage.color = new Color(1, 1f, 1, 1f); } } }