mirror of
https://github.com/DerTyp7/industrialize-unity.git
synced 2026-07-31 19:29:03 +02:00
menus
This commit is contained in:
32
Assets/Scripts/Menus/Menu.cs
Normal file
32
Assets/Scripts/Menus/Menu.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Menu : MonoBehaviour
|
||||
{
|
||||
public string id;
|
||||
public bool isOpen = false;
|
||||
|
||||
public void Open()
|
||||
{
|
||||
MenuManager.CloseAllMenus();
|
||||
gameObject.SetActive(true);
|
||||
isOpen = true;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
isOpen = false;
|
||||
}
|
||||
|
||||
public void Toggle()
|
||||
{
|
||||
if (isOpen)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
Open();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user