added reload animation and feature
This commit is contained in:
@@ -6,6 +6,7 @@ namespace Darkmatter.Presentation
|
||||
public class Enemy : MonoBehaviour, IDamageable
|
||||
{
|
||||
public float health = 100f;
|
||||
public Animator enemyAnimator;
|
||||
public void Die()
|
||||
{
|
||||
Debug.Log("Dead");
|
||||
@@ -15,6 +16,8 @@ namespace Darkmatter.Presentation
|
||||
public void TakeDamage(float damage)
|
||||
{
|
||||
health -= damage;
|
||||
enemyAnimator.SetLayerWeight(1, 1);
|
||||
enemyAnimator.SetTrigger("Hit");
|
||||
if (health <= 0) Die();
|
||||
Debug.Log("Damage Taken");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user