Scriptum/Assets/Scripts/SettingsButton.cs

58 lines
1.5 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) {
if (Panel.active == false)
{
//bool isActive = Panel.activeSelf;
Panel.SetActive(true);
}
else
{
Panel.SetActive(false);
}
}
}
public void CloseAssociatedPanel()
{
if (Panel != null) {
Panel.SetActive(false);
}
}
}
}