LunarInfantry/Assets/Scripts/Entity.cs
2026-01-04 01:44:17 -08:00

37 lines
674 B
C#

using System;
using UnityEngine;
public class Entity : MonoBehaviour
{
[Header("Health")]
public float health;
public float maxHealth;
[Header("Movement")]
public int maxMovement;
public TileObject currentTile;
[Header("Flags")]
public bool canMove = true;
public bool invincible;
public void TakeDamage(float damage)
{
health -= damage;
if (health <= 0)
{
OnKillEffects();
}
}
public void Heal(float healing)
{
health += healing;
health = Mathf.Clamp(health, 0, maxHealth);
}
protected virtual void OnKillEffects()
{
}
}