using UnityEngine;
using System.Collections;

public class boss_logic : MonoBehaviour {

	private global_variables variable_script;
	
	private GameObject gameManager;

	private Animator animator;
	
	// Use this for initialization
	void Start () {
		gameManager = GameObject.FindGameObjectWithTag ("GameController").gameObject;
		variable_script = gameManager.GetComponent<global_variables> ();
		animator = this.GetComponent<Animator> ();
	}
	
	// Update is called once per frame
	void Update () {
		if (variable_script.dialoguePosition == 3) {
			Invoke("move",2f);
			Invoke("stop_anim",2.8f);

		}
	
	}

	void stop_anim(){
		animator.SetBool ("eat_trigger", false);
	}

	void move(){
				animator.SetBool ("eat_trigger", true);
				transform.position = new Vector3 ((float)94.5, transform.position.y, (float)0);
				
				
		}
}
