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

public class ComboMeter : MonoBehaviour {

    public Image bar;
    public Text text;
    public Text score;

    float currentFillage;
    float targetFillage;
    float fillSpeed = 0.08f;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {

        if (Input.GetKey(KeyCode.L))
        {
            ComboCenter.Instance.IncreaseComboLevel(0.05f);
        }

        targetFillage = ComboCenter.Instance.GetComboRatio();

        currentFillage = Mathf.Lerp(currentFillage, targetFillage, fillSpeed);

        bar.fillAmount = currentFillage;

        text.text = "x" + ComboCenter.Instance.GetCombo();

        score.text = ComboCenter.Instance.GetScore();
	}
}
