рефакторю управление игроком
This commit is contained in:
1 parent
2746850727
commit
f632508497
18 files changed
+1044
-66
No files matched your search
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user