2022-11-19 17:02:31 +01:00
|
|
|
|
using UnityEditor;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class ChestController : MonoBehaviour
|
|
|
|
|
{
|
2022-12-29 00:56:54 +01:00
|
|
|
|
|
|
|
|
|
|
2022-11-19 17:02:31 +01:00
|
|
|
|
public void Update()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void OnTriggerStay2D(Collider2D collision)
|
|
|
|
|
{
|
2023-01-07 20:21:00 +01:00
|
|
|
|
if (collision.tag == "Player" && !gameObject.GetComponentInParent<ChestWrapper>().IsLocked)
|
2022-11-19 17:02:31 +01:00
|
|
|
|
{
|
|
|
|
|
ChestUIManager.Instance.CurrentChestName = gameObject.transform.parent.name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void OnTriggerExit2D(Collider2D collision)
|
|
|
|
|
{
|
2023-01-05 20:02:44 +01:00
|
|
|
|
if (collision.tag == "Player" && ChestUIManager.Instance.CurrentChestName != null)
|
2022-11-19 17:02:31 +01:00
|
|
|
|
{
|
|
|
|
|
ChestUIManager.Instance.ClosePanel();
|
2023-01-05 20:02:44 +01:00
|
|
|
|
|
|
|
|
|
ChestUIManager.Instance.CurrentChestName = null;
|
2022-11-19 17:02:31 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|