using UnityEngine;
using UnityEngine.UI;

public class ScoreHud : MonoBehaviour
{
	[SerializeField]
	Text playerText;

	[SerializeField]
	Text scoreText;

	public int score { get; private set; }

	public void Init(string playerName)
	{
		playerText.text = playerName;

		UpdateUI();
	}

	public void Increment()
	{
		++score;

		UpdateUI();
	}

	void UpdateUI()
	{
		scoreText.text = score.ToString();
	}
}