Здоровье чутка изменено
This commit is contained in:
1 parent
653342d080
commit
4ecafef8ee
6 files changed
+27
-50
No files matched your search
@@ -1,15 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.Example.Platformer.Entity
|
||||
{
|
||||
public class EntityHealth
|
||||
public class EntityHealth : MonoBehaviour
|
||||
{
|
||||
private int _health, _maxHealth;
|
||||
private int _health;
|
||||
private int _maxHealth;
|
||||
public void SetMaxHealth(int maxHealth) => _maxHealth = maxHealth;
|
||||
public bool IsDead { get; private set; }
|
||||
|
||||
public EntityHealth(int initialHealth)
|
||||
{
|
||||
_health = initialHealth;
|
||||
}
|
||||
|
||||
public void GiveDamage(int damage)
|
||||
{
|
||||
_health -= damage;
|
||||
|
||||
Reference in new issue
Block a user