added reload animation and bullet limit
This commit is contained in:
22
Assets/Darkmatter/Code/Presentation/Enemies/Enemy.cs
Normal file
22
Assets/Darkmatter/Code/Presentation/Enemies/Enemy.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Darkmatter.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Darkmatter.Presentation
|
||||
{
|
||||
public class Enemy : MonoBehaviour, IDamageable
|
||||
{
|
||||
public float health = 100f;
|
||||
public void Die()
|
||||
{
|
||||
Debug.Log("Dead");
|
||||
this.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void TakeDamage(float damage)
|
||||
{
|
||||
health -= damage;
|
||||
if (health <= 0) Die();
|
||||
Debug.Log("Damage Taken");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7cc0904e9eef2eb42860484c3c0d2675
|
||||
Reference in New Issue
Block a user