using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; class DialogueOpenCondition : MonoBehaviour { private void OnTriggerStay2D(Collider2D collision) { if (collision.tag == "Player") { ChestUIManager.Instance.CurrentChestName = gameObject.transform.parent.name; } } private void OnTriggerExit2D(Collider2D collision) { if (collision.tag == "Player") { ChestUIManager.Instance.CurrentChestName = null; ChestUIManager.Instance.ClosePanel(); } } }