using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class ScoreSystem : MonoBehaviour 
{
	public Text ScoreText;
	protected static Text scoreText;

	static int score = 0;

	[SerializeField]
	private InputController inputController;
	[SerializeField]
	private BuildController buildController;

	// Use this for initialization
	void Start () {
		scoreText = ScoreText;
	}

	public void Update ()
	{
		if (inputController.playersActiveKey.Length == 0 || buildController.Building)
			return;

		scoreText.text = (++score).ToString();
	}
	
	public static void Score()
	{
		score += 5000;
		scoreText.text = score.ToString();
	}
}
