mirror of
				https://github.com/DerTyp7/industrialize-unity.git
				synced 2025-10-31 21:37:09 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			728 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			728 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.Collections.Generic;
 | |
| using UnityEngine;
 | |
| public class BuildingMenu : Menu
 | |
| {
 | |
| 
 | |
|     [SerializeField] private Transform itemListParent;
 | |
|     [SerializeField] private GameObject itemPrefab;
 | |
| 
 | |
|     private void Start()
 | |
|     {
 | |
|         MenuDictionary.instance.Register(this);
 | |
|         CreateItemList();
 | |
|     }
 | |
| 
 | |
|     private void CreateItemList()
 | |
|     {
 | |
|         List<PlacedObjectTypeSO> placedObectTypeSOList = PlacedObjectsDictionary.instance.entries;
 | |
| 
 | |
|         foreach (PlacedObjectTypeSO p in placedObectTypeSOList)
 | |
|         {
 | |
|             BuildingMenuItem item = Instantiate(itemPrefab, Vector3.zero, Quaternion.identity, itemListParent).GetComponent<BuildingMenuItem>();
 | |
|             item.SetPlacedObjectType(p);
 | |
|         }
 | |
|     }
 | |
| 
 | |
| }
 | 
