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

public class AngerMeter : MonoBehaviour {

    RectTransform rt;
    Image img;

	// Use this for initialization
	void Start () 
    {
        rt = transform as RectTransform;
        img = GetComponent<Image>();
	}
	
	// Update is called once per frame
	void Update () 
    {
        Vector2 sd = rt.sizeDelta;
        sd.x = TownManager.tm.god_happiness * 300;
        rt.sizeDelta = sd;
        img.color = Color.Lerp(Color.red, Color.green, TownManager.tm.god_happiness);
	}
}
