Scriptum/Assets/Scripts/SettingsButton.cs

51 lines
1.4 KiB
C#
Raw Normal View History

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);
}
}
}
}