using UnityEngine;
using UnityEngine.UI;

public class ScoreManager : MonoBehaviour
{
    public bool isEnabled = true;
    public int points = 0;
    public Text uiText;
    public Text GoUiText;

    private void Start()
    {
        if (isEnabled)
        {
            updateText();
        }
    }

    public void addPoints(int add)
    {
        if (isEnabled)
        {
            this.points += add;
            updateText();
        }
    }

    private void updateText()
    {
        if (isEnabled)
        {
            if (uiText != null) uiText.text = "" + points;
            if (GoUiText != null) GoUiText.text = "Score: " + points;
        }
    }
}
