Files
No-Time-To-Rest/Assets/Scripts/Enemies/Enemy.cs
T

12 lines
230 B
C#

using UnityEngine;
public class Enemy : MonoBehaviour
{
public float hp = 100f;
public GameObject prefab;
public void DealDamage(float damage) {
hp -= damage;
if (hp <= 0) Destroy(gameObject);
}
}