Scriptum/Assets/Scripts/SettingsButton.cs
2022-06-10 11:02:51 +02:00

51 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace GUI_Scripts
{
public class SettingsButton:MonoBehaviour
{
public GameObject Panel;
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()
{
if (Panel != null) {
//bool isActive = Panel.activeSelf;
Panel.SetActive(true);
}
}
public void CloseAssociatedPanel()
{
if (Panel != null) {
Panel.SetActive(false);
}
}
}
}