то же самое
This commit is contained in:
1 parent
090cdc9933
commit
ac99977be3
534 files changed
+36990
-48
No files matched your search
@@ -1,7 +1,21 @@
|
||||
namespace DefaultNamespace
|
||||
using UnityEngine;
|
||||
|
||||
public class MutantHealth : MonoBehaviour
|
||||
{
|
||||
public class MutantHealth
|
||||
public float maxHealth = 50f;
|
||||
private float currentHealth;
|
||||
|
||||
void Start() { currentHealth = maxHealth; }
|
||||
|
||||
public void TakeDamage(float damage)
|
||||
{
|
||||
currentHealth -= damage;
|
||||
Debug.Log("Мутант получил урон! Осталось: " + currentHealth);
|
||||
|
||||
if (currentHealth <= 0)
|
||||
{
|
||||
Debug.Log("МУТАНТ УМЕР!");
|
||||
Destroy(gameObject); // Уничтожаем модельку мутанта
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user