Scriptum/Assets/Scripts/REFACTORING/Application/Dialogue/Condition/DialogueOpenCondition.cs

29 lines
642 B
C#
Raw Permalink Normal View History

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();
}
}
}