From fbc9c88d5932225ae198b776ea9b2f4e981770aa Mon Sep 17 00:00:00 2001 From: yonggyun Date: Wed, 25 Jun 2025 16:18:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B8=EB=B2=A4=ED=86=A0=EB=A6=AC=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B2=AB=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scirpts/Inventory.cs | 46 ++++++++++++++++++++++++++++++++ Assets/Scirpts/Inventory.cs.meta | 2 ++ 2 files changed, 48 insertions(+) create mode 100644 Assets/Scirpts/Inventory.cs create mode 100644 Assets/Scirpts/Inventory.cs.meta diff --git a/Assets/Scirpts/Inventory.cs b/Assets/Scirpts/Inventory.cs new file mode 100644 index 000000000..deb9a76df --- /dev/null +++ b/Assets/Scirpts/Inventory.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace DDD +{ + public class Inventory : MonoBehaviour + { + Dictionary inventory; + private List unusedItems; + + void Start() + { + var task= GoogleSheetManager.LoadSo(); + var items = task.Result; + + unusedItems = new List(); + + // TODO: 데이터에서 가져오기 + inventory = new Dictionary(); + inventory["0"] = items.ItemList[0]; + inventory["1"] = items.ItemList[1]; + inventory["2"] = items.ItemList[2]; + UpdateItemList(); + } + + public void UpdateItemList() + { + RectTransform inventoryRoot; + RectTransform itemPrefab; + + var counts = inventoryRoot.childCount; + for (int i = 0; i < counts; ++i) + { + var child = inventoryRoot.GetChild(0); + unusedItems.Add(child as RectTransform); + child.SetParent(null); + child.gameObject.SetActive(false); + } + + foreach (var item in inventory) + { + + } + } + } +} \ No newline at end of file diff --git a/Assets/Scirpts/Inventory.cs.meta b/Assets/Scirpts/Inventory.cs.meta new file mode 100644 index 000000000..fc12199ea --- /dev/null +++ b/Assets/Scirpts/Inventory.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6c667d81563204249aea17e2052c7e50 \ No newline at end of file