че та
This commit is contained in:
1 parent
de6fdb1e47
commit
6e3d5ab9a2
7 files changed
+188
No files matched your search
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Target : MonoBehaviour
|
||||
{
|
||||
public float health = 50f;
|
||||
|
||||
public void TakeDamage(float amount)
|
||||
{
|
||||
health -= amount;
|
||||
if (health <= 0f)
|
||||
{
|
||||
Die();
|
||||
}
|
||||
}
|
||||
|
||||
void Die()
|
||||
{
|
||||
// For now, we'll just destroy the target object
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user