using UnityEngine;
using System.Collections;

public class BirdAnimationManager : MonoBehaviour {

	public enum AnimationStates
	{
		Idle=0,
		Walking=1,
		TakeOff=2,
		Flutter=3,
		Glide=4,
		Land =5

	};
	public static BirdAnimationManager MASTER;
	public Animator birdBody;
	public Animator birdFace;
	void Start()
	{
		if (MASTER != null)
			return;
		MASTER = this;
	}

	private float EatStart = 0f;

	public void changeState(AnimationStates state)
	{
		birdBody.SetInteger ("State", (int)state);
		birdFace.SetInteger ("State", (int)state);
		//Debug.Log (state.ToString());


	}

	void Update() {
		if (Time.time > (EatStart + 3f)) {
			birdFace.SetBool ("Eat", false);
		}
	}
	public void BirdIsEating()
	{
		birdFace.SetBool ("Eat", true);
		EatStart = Time.time;
//		birdFace.SetBool ("Eat", false);
	}
}
