아이탬 구매 자원 업데이트

This commit is contained in:
김판돌 2024-03-02 22:44:44 +09:00
parent fe3520deb3
commit e7f121a2d6
5 changed files with 11 additions and 8 deletions

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class GameCtrl : MonoBehaviour
public class GameCtrl : SingletonMonoBehaviour<GameCtrl>
{
[SerializeField] TMP_Text[] goldText;
[SerializeField] TMP_Text[] cashText;

View File

@ -127,14 +127,11 @@ public class MainCtrl : MonoBehaviour
Statics.equipment = data.equipment.OrderBy(n => n.equipment_data_id).ToList();
//유닛정보 Set
foreach (DeckUnitInfo item in units)
{
Statics.deckUnit.Add(item.id, item);
}
//다이나믹 데이터 Set
foreach(var item in data.dynamic_data)
{
foreach (var item in data.dynamic_data)
Statics.dynamic.Add(item.name, item.value);
}
Statics.nickname = data.nickname;
Statics.gold = data.gold;

View File

@ -26,6 +26,9 @@ public class ShopType1itemPrefab : MonoBehaviour
resp.Request((data) =>
{
Debug.Log("아이템 구매 성공");
Statics.gold = data.gold;
Statics.cash = data.cash;
GameCtrl.Instance.MoneyUpdate();
}, shopItemData.index);
}

View File

@ -26,6 +26,9 @@ public class ShopType2itemPrefab : MonoBehaviour
resp.Request((data) =>
{
Debug.Log("아이템 구매 성공");
Statics.gold = data.gold;
Statics.cash = data.cash;
GameCtrl.Instance.MoneyUpdate();
}, shopItemData.index);
}
}

View File

@ -184,8 +184,8 @@ public class BuyShopItemResp : Request<BuyShopItemResp>
public long addGold { get; set; }
public long addCash { get; set; }
public long gold { get; set; }
public long cash { get; set; }
public ulong gold { get; set; }
public ulong cash { get; set; }
public List<DeckUnitInfo> deck_unit { get; set; }
public List<Equipment> equipment { get; set; }
public List<ConsumableItem> consumableItem { get; set; }