//敌人血量为0时死亡
if (ZombieHealth <= 0)
{
Alive = false;
Animator.SetBool("Die", true);
NavMeshAgent.Stop();
Destroy(GetComponent
StartCoroutine(ZombieDie());
}
if ((_animatorInfo.normalizedTime > 1 && _animatorInfo.IsName("base Layer.hit")))
{
Animator.SetBool("Hit", false);
}
if (ZombieHealth <= 0)
ZombieHealth = 0;
}
//死亡后销毁游戏对象
IEnumerator ZombieDie()
{
yield return new WaitForSeconds(5.0f);
Destroy(this.gameObject);
//ZombieHealth = 50;
}



