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

public class Silhouette : MonoBehaviour
{

    public string Type;

    //say
    //mojo
    //dollas

    public Image MoneyBar;
    public Image MojoBar;

    public Bubble speech;
    public Bubble think;

    public float minMoney = 0;
    public float maxMoney = 1;

    public float minMojo = 0;
    public float mazMojo = 1;

    public float money = 0f;
    public float mojo = 0f;

    public void Say(string text)
    {
        speech.SetText(text); 
    }
    public void Think(string text)
    {
        think.SetText(text);
    }
    void Awake()
    {
    }
    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        var moneyFill = Mathf.Lerp(0.2f, 1, money);
        var mojoFill = Mathf.Lerp(0.2f, 1, mojo);

        if (MoneyBar.fillAmount > moneyFill)
            MoneyBar.fillAmount -= Time.deltaTime;
        if (MoneyBar.fillAmount < moneyFill)
            MoneyBar.fillAmount += Time.deltaTime;

        if (MojoBar.fillAmount > mojoFill)
            MojoBar.fillAmount -= Time.deltaTime;
        if (MojoBar.fillAmount < mojoFill)
            MojoBar.fillAmount += Time.deltaTime;

    }


}
