diff --git a/Assets/BuildingMenu.cs b/Assets/BuildingMenu.cs new file mode 100644 index 0000000..28528e2 --- /dev/null +++ b/Assets/BuildingMenu.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class BuildingMenu : MonoBehaviour +{ + + [SerializeField] GameObject slotPrefab; + [SerializeField] List placedObjectTypeSOList; + + void Start() + { + foreach(PlacedObjectTypeSO p in placedObjectTypeSOList) + { + GameObject slot = Instantiate(slotPrefab, gameObject.transform); + slot.GetComponent().placedObjectTypeSO = p; + } + } + + +} diff --git a/Assets/BuildingMenu.cs.meta b/Assets/BuildingMenu.cs.meta new file mode 100644 index 0000000..111ba60 --- /dev/null +++ b/Assets/BuildingMenu.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bcce99e456cd44549aa61d6dd97c9846 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/BuildingMenuSlot.cs b/Assets/BuildingMenuSlot.cs new file mode 100644 index 0000000..2aad2c7 --- /dev/null +++ b/Assets/BuildingMenuSlot.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using TMPro; + +public class BuildingMenuSlot : MonoBehaviour +{ + public PlacedObjectTypeSO placedObjectTypeSO; + + Image img; + Button btn; + TextMeshProUGUI textObj; + + void Start() + { + img = transform.Find("Image").gameObject.GetComponent(); + btn = GetComponent