Scriptum/Assets/Scripts/REFACTORING/Application/Chest/ChestController.cs
kabix09 88ab6bcee7 Add Shop module
Add Shop panel & saving module
2022-12-19 03:34:45 +01:00

30 lines
585 B
C#

using UnityEditor;
using UnityEngine;
public class ChestController : MonoBehaviour
{
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();
}
}
}