Scriptum/Assets/Scripts/REFACTORING/Application/Dialogue/Condition/DialogueOpenCondition.cs
kabix09 e26bbce901 Wizard - first action - fix
Dialogue add base trigger
2022-12-20 15:23:09 +01:00

29 lines
642 B
C#

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