µ
This commit is contained in:
parent
98b571c2aa
commit
f7b593045f
9 changed files with 49 additions and 132 deletions
|
|
@ -6,12 +6,12 @@ public class ShopUI : MonoBehaviour {
|
|||
public GameObject shopUI;
|
||||
private Shop _shop;
|
||||
private ShopSlot[] _slots;
|
||||
|
||||
|
||||
private void Start() {
|
||||
// Get Shop instance and add UpdateUI method to OnItemChanged delegate
|
||||
_shop = Shop.instance;
|
||||
_shop.onItemChangedCallback += UpdateUI;
|
||||
|
||||
|
||||
// Add all ShopSlot GameObjects to _slots and turn off the Shop UI
|
||||
_slots = itemsParent.GetComponentsInChildren<ShopSlot>();
|
||||
ToggleShop();
|
||||
|
|
@ -45,7 +45,7 @@ public class ShopUI : MonoBehaviour {
|
|||
if(i < _shop.items.Count) {
|
||||
_slots[i].AddItem(_shop.items.ElementAt(i).Key);
|
||||
_slots[i].nameText.text = _slots[i].Item.displayName;
|
||||
_slots[i].costText.text = _slots[i].Item.cost + " €";
|
||||
_slots[i].costText.text = _slots[i].Item.cost + " µ";
|
||||
_slots[i].amountText.text = _shop.items[_shop.items.ElementAt(i).Key] + " #";
|
||||
} else {
|
||||
_slots[i].ClearSlot();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue