Build Shop
Shop now shows the current coins of the player
This commit is contained in:
1 parent
59b80c0ab2
commit
7e9d715574
5 files changed
+459
-118
No files matched your search
@@ -8,17 +8,19 @@ public class ItemShop : MonoBehaviour
|
||||
[SerializeField] private UIItem[] items;
|
||||
|
||||
public static Player currentPlayer = null;
|
||||
[SerializeField] private TMP_Text textPlayerCoins;
|
||||
|
||||
public void Init(Player _currentPlayer)
|
||||
{
|
||||
currentPlayer = _currentPlayer;
|
||||
textPlayerCoins.text = currentPlayer.coins + "";
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
foreach(UIItem ui in items)
|
||||
{
|
||||
TMP_Text text = ui.GetComponentInChildren<TMP_Text>();
|
||||
TMP_Text text = ui.GetComponentsInChildren<TMP_Text>()[0];
|
||||
text.text = ui.item.Cost + "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user