2022-05-20 13:38:43 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
namespace GUI_Scripts
|
|
|
|
{
|
|
|
|
public class SettingsButton:MonoBehaviour
|
|
|
|
{
|
|
|
|
public GameObject Panel;
|
2022-06-09 22:34:39 +02:00
|
|
|
|
|
|
|
public void manageWindow()
|
|
|
|
{
|
|
|
|
if(!InventoryManager.Instance.isOpen && !EquipmentManager.Instance.isOpen)
|
|
|
|
this.OpenPlayerPanel();
|
|
|
|
else
|
|
|
|
this.ClosePlayerPanel();
|
|
|
|
|
|
|
|
}
|
|
|
|
public void OpenPlayerPanel() {
|
|
|
|
|
|
|
|
if(!InventoryManager.Instance.isOpen || !EquipmentManager.Instance.isOpen)
|
|
|
|
{
|
|
|
|
InventoryManager.Instance.OpenPanel();
|
|
|
|
EquipmentManager.Instance.OpenPanel();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ClosePlayerPanel() {
|
|
|
|
if(InventoryManager.Instance.isOpen || EquipmentManager.Instance.isOpen)
|
|
|
|
{
|
|
|
|
InventoryManager.Instance.ClosePanel();
|
|
|
|
EquipmentManager.Instance.ClosePanel();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OpenAssociatedPanel()
|
|
|
|
{
|
2022-05-20 13:38:43 +02:00
|
|
|
if (Panel != null) {
|
|
|
|
//bool isActive = Panel.activeSelf;
|
|
|
|
Panel.SetActive(true);
|
|
|
|
}
|
2022-06-09 22:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void CloseAssociatedPanel()
|
|
|
|
{
|
|
|
|
if (Panel != null) {
|
2022-05-20 13:38:43 +02:00
|
|
|
Panel.SetActive(false);
|
|
|
|
}
|
2022-06-09 22:34:39 +02:00
|
|
|
}
|
2022-05-20 13:38:43 +02:00
|
|
|
}
|
|
|
|
}
|