Files
PuzzleColorBall/Assets/Scripts/CoinCounter.cs

30 lines
706 B
C#
Raw Normal View History

2023-02-27 12:09:47 +01:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2023-03-09 14:07:44 +01:00
using TMPro;
2023-02-27 12:09:47 +01:00
public class CoinCounter : MonoBehaviour
{
2023-03-07 13:55:45 +01:00
public ulong coin = 0; //szedje le db-bol a playerhez a coint
2023-03-09 14:07:44 +01:00
public TMP_Text coinCounterUI;
2023-02-27 12:09:47 +01:00
2023-03-07 21:06:25 +01:00
private DatabaseData dd;
//get player coin at startup based on username
private void Awake() {
dd = FindObjectOfType<DatabaseData>();
//dd.GetCoinData("Playmaker1210");
}
2023-02-27 12:09:47 +01:00
public void AddCoin(ulong number){
coin += number;
2023-03-09 16:00:42 +01:00
coinCounterUI.text = "Coins: " + coin.ToString();
2023-02-27 12:09:47 +01:00
}
public void RemoveCoin(ulong number){
coin -= number;
2023-03-09 16:00:42 +01:00
//coinCounterUI.text = "Coins: " + coin.ToString();
2023-02-27 12:09:47 +01:00
}
}