using System.Collections; using System.Collections.Generic; using UnityEngine; public class ShowUI : MonoBehaviour { public GameObject ZheZhao; private void OnTriggerEnter(Collider other) { if (other.tag == "architecture") { Debug.Log("进入"); GameManager.Instance.isShowUI = false; if (SceneLoader.instance.isOnLoad) ZheZhao.SetActive(true); } } private void OnTriggerExit(Collider other) { if (other.tag == "architecture") { Debug.Log("离开"); GameManager.Instance.isShowUI = true; ZheZhao.SetActive(false); GameManager.Instance.Architectures.ForEach(x => x.SetActive(true)); } } }