using UnityEngine;
using System.Collections;

public class PAnimCont : MonoBehaviour 
{

	Animator anim;
	
	void Awake()
	{
		anim = GetComponent<Animator> ();
	}

	void OnTriggerEnter2D(Collider2D col)
	{
		if(col.gameObject.tag == "Player1" || col.gameObject.tag == "Player2")
		{
			anim.SetBool("Enabled", true);
		}
	}
	
	void OnTriggerExit2D(Collider2D col)
	{
		if(col.gameObject.tag == "Player" || col.gameObject.tag == "Player2")
		{
			anim.SetBool("Enabled", false);
		}
	}
}
