Build Shop
Shop now shows the current coins of the player
This commit is contained in:
@@ -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