using UnityEngine; using XFrame.Core.UI; using XFrame.Core.UIs; using UnityEngine.SceneManagement; public class Trigger_Arrive : Trigger_Objective { public static Trigger_Arrive instance; [HideInInspector]public bool isEnter; void Awake() { instance = this; } public override void OnTriggerEnter(Collider other) { if (other.transform.name.Contains("ColliderFront")) { base.OnTriggerEnter(other); isEnter = true; XUIPanel.ShowPanel((a)=> { if ((bool)a) { SceneManager.LoadScene(GameFlowManager.instance.scene.name); } },"",false); XUIPanels.ShowPanel((a) => { if ((bool)a) { SceneManager.LoadScene(GameFlowManager.instance.scene.name); } }, "", false); } } public override void OnTriggerExit(Collider other) { if (other.transform.name.Contains("ColliderFront")) { base.OnTriggerExit(other); isEnter = false; XUIPanel.ClosePanel(); XUIPanels.ClosePanel(); } } }