using System.Collections; using System.Collections.Generic; using UnityEngine; using XFrame.Core.UI; using XFrame.Core.UIs; public class Trigger_CrossWaring : MonoBehaviour { public GameObject Persons; private void OnTriggerEnter(Collider other) { if (other.transform.name.Contains("ColliderFront")) { Persons.SetActive(true); XUIPanel.ShowPanel(); XUIPanels.ShowPanel(); } } private void OnTriggerExit(Collider other) { if (other.transform.name.Contains("ColliderFront")) { Persons.SetActive(false); XUIPanel.ClosePanel(); XUIPanels.ClosePanel(); this.gameObject.SetActive(false); } } }