using System;

using UnityEngine;
using UnityEngine.UI;


public class ScoreManager : MonoBehaviour
{
    public int Points;
    public int Money = 1000;
    public float TimeLeft = 90;

    public Text PointsDisplayer;
    public Text MoneyDisplayer;
    public Text TimeDisplayer;

    public static ScoreManager Instance;

    public void Awake()
    {
        Instance = this;
    }
    
    public void Update()
    {
        if (TimeLeft > 0 && !GameplayManager.GameOver)
        {
            TimeLeft -= Time.deltaTime;
        }
            
        MoneyDisplayer.text = "$" + Money;
        PointsDisplayer.text = string.Format("{0:D}P", Points);
        TimeDisplayer.text = string.Format("{0:00}", Math.Round(TimeLeft));
    }
}