Animation play when dead

How do I make an animation play when a person dies?

using UnityEngine;
using System.Collections;

public class EnemyHealth : MonoBehaviour {
	public int maxHealth = 100;
	public int curHealth = 100;
	
	public float healthBarLength;
		
	// Use this for initialization
	void Start () {
		healthBarLength = Screen.width /2;
	}
	
	// Update is called once per frame
	void Update () {
		AddjustCurrentHealth(0);
	
	}
	
	void OnGUI() {
	GUI.Box(new Rect(10, 40, healthBarLength, 20), curHealth + "/" + maxHealth);
	}
	
	public void AddjustCurrentHealth(int adj) {
		curHealth += adj;
		
		if(curHealth < 0)
			curHealth = 0;
		if(curHealth > maxHealth)
			curHealth = maxHealth;
		if(maxHealth <1)
			maxHealth = 1;
		healthBarLength = (Screen.width / 2) * (curHealth /(float)maxHealth);
		
	}
}

My proposal is - in Mecanim create state called Dead which will have “dead” animation assigned to it. Then make transition to this state, make curHealth as transition parameter and set transition’s condition following: curHealth Less 1.

declare an Animation as anim and then play the death animation
public anim : Animation;

then in update play the animation when the player health = 0 using

anim.Play(“DeathAnimation”);