Scriptum/Assets/Scripts/SettingsButton.cs

64 lines
1.7 KiB
C#
Raw Permalink Normal View History

2023-01-02 00:37:49 +01:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace GUI_Scripts
{
public class SettingsButton:MonoBehaviour
{
public GameObject Panel;
public void manageWindow()
{
2022-11-24 03:03:30 +01:00
if(!InventoryUIManager.Instance.GetPanelStatus() && !EquipmentUIManager.Instance.GetPanelStatus())
this.OpenPlayerPanel();
else
this.ClosePlayerPanel();
}
public void OpenPlayerPanel() {
2022-11-24 03:03:30 +01:00
if(!InventoryUIManager.Instance.GetPanelStatus() || !EquipmentUIManager.Instance.GetPanelStatus())
{
2022-11-06 21:34:17 +01:00
InventoryUIManager.Instance.OpenPanel();
2022-11-24 03:03:30 +01:00
EquipmentUIManager.Instance.OpenPanel();
}
}
public void ClosePlayerPanel() {
2022-11-24 03:03:30 +01:00
if(InventoryUIManager.Instance.GetPanelStatus() || EquipmentUIManager.Instance.GetPanelStatus())
{
2022-11-06 21:34:17 +01:00
InventoryUIManager.Instance.ClosePanel();
2022-11-24 03:03:30 +01:00
EquipmentUIManager.Instance.ClosePanel();
}
}
public void OpenAssociatedPanel()
{
if (Panel != null) {
if (Panel.active == false)
{
//bool isActive = Panel.activeSelf;
Panel.SetActive(true);
}
else
{
Panel.SetActive(false);
}
}
}
public void CloseAssociatedPanel()
{
if (Panel != null) {
Panel.SetActive(false);
}
}
2023-01-02 00:37:49 +01:00
[SerializeField] private CanvasGroup keybindMenu;
}
}