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

public class InGamePanel : MonoBehaviour {
    public Text timeText;
    public Text blueTeamScore;
    public Text redTeamScore;
    public Text result;

    #region singleton

    static InGamePanel instance;

    public static InGamePanel GetInstance()
    {
        if (instance == null)
            instance = FindObjectOfType<InGamePanel>();
        return instance;
    }

    #endregion
    // Use this for initialization
    void Start () {
	
	}
	
    public void SetResult(bool isWin)
    {
        if (isWin)
        {
            result.text = "You Win~";
        }
        else
        {
            result.text = "You Lost~";
        }
    }

	// Update is called once per frame
	void Update () {
        if (Game.GetInstance() == null)
            return;
        timeText.text = "Time: " + Game.GetInstance().timeRemaing.ToString("f2");
        blueTeamScore.text = "Score: " + Game.GetInstance().blueTeamScore;
        redTeamScore.text = "Score: " + Game.GetInstance().redTeamScore;

    }
}
