mirror of
				https://github.com/DerTyp7/industrialize-unity.git
				synced 2025-11-04 06:59:00 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			494 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			494 B
		
	
	
	
		
			C#
		
	
	
	
	
	
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();
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |