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

public class Score : MonoBehaviour
{
    public static Score Instance;
    [SerializeField]
    Text scoreText,
        scoreShadowText;

    [SerializeField]
    Animator
        anim;

    int score;

	// Use this for initialization
	void Awake ()
    {
	    if(Instance == null)
        {
            Instance = this;
        }	
        else
        {
            Destroy(this);
            Debug.LogWarning("Multiple score texts found");
        }

	}

    public void UpdateScore(int amount)
    {
        score += amount;
        scoreText.text = score.ToString();
        scoreShadowText.text = score.ToString();
        anim.SetTrigger("UpdateScore");
    }
}
