상점 아이템 세팅용 코드 작성
This commit is contained in:
parent
df7cddd4d8
commit
4dca1cdd62
|
|
@ -18299,7 +18299,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1699950330
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
|
|
@ -138,6 +138,39 @@ 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++)
|
||||
{
|
||||
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();
|
||||
itemData.id = item.id;
|
||||
itemData.index = item.reset_shop_item_data_id;
|
||||
itemData.name = item.name;
|
||||
itemData.shop_index = item.shop_index;
|
||||
itemData.buy_type = item.buy_type;
|
||||
itemData.buy = item.buy;
|
||||
itemData.reward = item.reward;
|
||||
itemData.buy_count = item.buy_count;
|
||||
Statics.shopItems.Add(itemData.index, itemData);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ public class ShopItemData : Excel
|
|||
public eBuyType buy_type;
|
||||
public int buy;
|
||||
public long reward;
|
||||
public int buy_count;
|
||||
|
||||
public long id = -1;
|
||||
|
||||
public override void toJson()
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ public class Statics
|
|||
|
||||
public static Dictionary<string, Sprite> stringIcons = new Dictionary<string, Sprite>();
|
||||
|
||||
public static Dictionary<long, ShopItemData> shopItems;
|
||||
|
||||
//서버에서 내려주는 데이터들
|
||||
public static string uuid;
|
||||
public static Dictionary<string, string> dynamic = new Dictionary<string, string>();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue