first commit

This commit is contained in:
2026-06-04 20:14:47 +03:00
commit a70f7fe2b9
143 changed files with 19543 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
using UnityEngine;
public class Enemy : MonoBehaviour
{
public string enemyType = "Goblin";
public int health = 100;
public bool IsDead { get; private set; }
public void TakeDamage(int amount)
{
if (IsDead || amount <= 0)
{
return;
}
health -= amount;
if (health <= 0)
{
Die();
}
else if (NotificationUI.Instance != null)
{
NotificationUI.Instance.Show($"{enemyType}: {health} HP");
}
}
public void Die()
{
if (IsDead)
{
return;
}
IsDead = true;
if (QuestManager.Instance != null)
{
QuestManager.Instance.OnEnemyKilled(enemyType);
}
if (NotificationUI.Instance != null)
{
NotificationUI.Instance.Show($"{enemyType} уничтожен");
}
Destroy(gameObject);
}
}