money and daycount ui added

This commit is contained in:
s-prechtl 2022-06-02 14:48:24 +02:00
parent d28a1947eb
commit 9e082537d8
4 changed files with 819 additions and 9 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UIElements;
using Cursor = UnityEngine.Cursor;
@ -21,14 +22,17 @@ public class PlayerController : MonoBehaviour {
#endregion
private Inventory _inventory;
public int money;
private int _money;
private UsableItem _selectedItem;
public int startMoney = 100;
public TextMeshProUGUI moneyTextMeshProUGUI;
public int Money => _money;
// Start is called before the first frame update
private void Start() {
money = startMoney;
_money = startMoney;
_inventory = Inventory.instance;
}
@ -44,4 +48,9 @@ public class PlayerController : MonoBehaviour {
public UsableItem GetSelectedItem() {
return _selectedItem;
}
public void ChangeMoney(int amount) {
_money += amount;
moneyTextMeshProUGUI.text = amount + "µ";
}
}