mirror of
				https://github.com/DerTyp7/industrialize-unity.git
				synced 2025-10-31 05:17:10 +01: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
	 Janis
					Janis