Scriptum/Assets/Scripts/REFACTORING/Application/Chest/ChestController.cs

32 lines
595 B
C#
Raw Normal View History

using UnityEditor;
using UnityEngine;
public class ChestController : MonoBehaviour
{
2022-12-29 00:56:54 +01:00
public void Update()
{
}
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();
}
}
}