using UnityEngine;
using System.Collections;

public class ScoreBoard : MonoBehaviour {

    public static ScoreBoard instance;

    public int BabiesHatched = 0;
    public int EggsLeft = 10;

    void Start()
    {
        instance = this;
    }

    void Update()
    {
        if (GameController.Instance.isGameRunning() && EggsLeft <= 0)
        {
            Debug.Log("Scoreboard: We lost!");
            GameController.Instance.LoseGame();
        }
    }

    void OnLevelWasLoaded()
    {
        if (GameController.Instance.isInPlayScreen())
        {
            Debug.Log("Resetting score for new round");
            BabiesHatched = 0;
            EggsLeft = 10;
        }
    }


}
