Files
Souljack/Assets/_Project/Scripts/IDamagable.cs
T

17 lines
384 B
C#

using UnityEngine;
public class TargetDummy : MonoBehaviour, IDamageable
{
[SerializeField] private float health = 100f;
public void TakeDamage(float amount)
{
health -= amount;
Debug.Log($"Враг получил {amount} урона. Осталось HP: {health}");
if (health <= 0)
{
Destroy(gameObject);
}
}
}