Play animation and then destory object after being clicked

My aim is to basically make an idle shooter game (rail shooter) where an enemy appears on the screen and when the player simply clicks the enemy, a dying animation is played once and then the enemy leaves the screen.

using System.Collections;
using UnityEngine;
using UnityEngine.Animations;

public class ClickAndDestroy : MonoBehaviour
{
public Animation DyingAnimation;
public string Dying;
Animation anim;

void Update()
{
    if (Input.GetMouseButtonDown(0))
    {
        RaycastHit hit;
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        if (Physics.Raycast(ray, out hit))
        {
            BoxCollider bc = hit.collider as BoxCollider;
            if (hit.transform.tag == "Enemy")
            {
                Debug.Log("Dead!");
                anim["Dying"].wrapMode = WrapMode.Once;
                anim.Play("Dying");
                Animation.Play(DyingAnimation);
                Destroy(bc.gameObject);
            }
        }
    }
}

}

This is my code right now which is attached to the main camera. However, when I click the enemy, it disappears but the dying animation is not played. Please help

put the Destroy(br.gameObject); in a coroutine

something like this

private IEnumerator DestroyWithDelay(float delayInSeconds, GameObject go){
    yield return new WaitForSeconds(delayInSeconds);
    Destroy(go);
}

and instead of line 17 write something like this

StartCoroutine(DestroyWithDelay(anim["Dying"].Length, bc.gameObject));

With a coroutine you start a little independent update function that waits for a defined time and then executes the code you define after your yield return statement.