diff --git a/Client/Assets/1_Script/MainCtrl.cs b/Client/Assets/1_Script/MainCtrl.cs index de9ef2ca..3bceea17 100644 --- a/Client/Assets/1_Script/MainCtrl.cs +++ b/Client/Assets/1_Script/MainCtrl.cs @@ -138,24 +138,24 @@ public class MainCtrl : MonoBehaviour else GameManager.Instance.NextScene(GameManager.eScene.Game); - //data.shop_item - // Statics.excelDatas.shopItems + //»óÁ¡ µ¥ÀÌÅÍ foreach(var item in Statics.excelDatas.shopItemData) { item.Value.id = -1; Statics.shopItems.Add(item.Key, item.Value); } - for (int n = 0; n < data.shop_item.Count; n++) { + if (Statics.shopItems[data.shop_item[n].shop_item_data_id].buy_count == -1) + continue; Statics.shopItems[data.shop_item[n].shop_item_data_id].buy_count--; - if(Statics.shopItems[data.shop_item[n].shop_item_data_id].buy_count == 0) { Statics.shopItems.Remove(data.shop_item[n].shop_item_data_id); } } + //¸®¼Â¾ÆÀÌÅÛ µ¥ÀÌÅÍ foreach (var item in data.reset_shop_item) { ShopItemData itemData = new ShopItemData(); @@ -166,7 +166,7 @@ public class MainCtrl : MonoBehaviour itemData.buy_type = item.buy_type; itemData.buy = item.buy; itemData.reward = item.reward; - itemData.buy_count = item.buy_count; + itemData.buy_count = item.count; Statics.shopItems.Add(itemData.index, itemData); } diff --git a/Client/Assets/1_Script/Prefab/ShopTypeitemPrefab.cs b/Client/Assets/1_Script/Prefab/ShopTypeitemPrefab.cs index e6585da7..b5837e08 100644 --- a/Client/Assets/1_Script/Prefab/ShopTypeitemPrefab.cs +++ b/Client/Assets/1_Script/Prefab/ShopTypeitemPrefab.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using TMPro; @@ -16,12 +17,11 @@ public class ShopTypeitemPrefab : MonoBehaviour this.shopItemData = shopItemData; pay.text = "£Ü" + shopItemData.buy.ToString(); OnSet(shopItemData); + Debug.Log($"{shopItemData.name} : {shopItemData.buy_count} : {shopItemData.buy_count != 0}"); + gameObject.SetActive(shopItemData.buy_count != 0); } - virtual protected void OnSet(ShopItemData shopItemData) - { - - } + virtual protected void OnSet(ShopItemData shopItemData) {} public void BuyItemButton() { @@ -40,6 +40,9 @@ public class ShopTypeitemPrefab : MonoBehaviour Statics.itemManager.box.add(data.consumableItem); Statics.itemManager.box.add(data.etcItem); GetItemWindows.Instance.SetUI(addGold, addCash, data.deck_unit, data.equipment, data.consumableItem, data.etcItem); + + shopItemData.buy_count--; + gameObject.SetActive(shopItemData.buy_count != 0); }, shopItemData.index, shopItemData.id); } } diff --git a/Client/Assets/1_Script/System/Statics.cs b/Client/Assets/1_Script/System/Statics.cs index 306564e2..4cdc54bd 100644 --- a/Client/Assets/1_Script/System/Statics.cs +++ b/Client/Assets/1_Script/System/Statics.cs @@ -20,7 +20,7 @@ public class Statics public static Dictionary stringIcons = new Dictionary(); - public static Dictionary shopItems; + public static Dictionary shopItems = new Dictionary(); //¼­¹ö¿¡¼­ ³»·ÁÁÖ´Â µ¥ÀÌÅ͵é public static string uuid;