using UnityEngine;
using System.Collections;

public class PlayerAnimator : MonoBehaviour 
{
	Animator anim;

	void Awake()
	{
		anim = GetComponent<Animator> ();
	}
	
	void FixedUpdate () 
	{
		anim.SetFloat ("VelocityX", rigidbody2D.velocity.x);
		anim.SetFloat("VelocityY", rigidbody2D.velocity.y);

		if (rigidbody2D.velocity.x == 0 && rigidbody2D.velocity.y == 0)
		{
			anim.SetBool("Idle", true);
		}
		else
		{
			anim.SetBool("Idle", false);
		}
	}
}
