35 lines
833 B
C#
35 lines
833 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();
|
|
|
|
// Close additiona panels
|
|
if (EquipmentUIManager.Instance.GetPanelStatus()) EquipmentUIManager.Instance.ClosePanel();
|
|
|
|
if (InventoryUIManager.Instance.GetPanelStatus()) InventoryUIManager.Instance.ClosePanel();
|
|
}
|
|
}
|
|
}
|