Files
KOSMOGOR d4589318f2 add: player UI
update: some enemies balance
2025-04-28 14:20:49 +03:00

22 lines
381 B
C#

using UnityEngine;
public class Player : MonoBehaviour
{
public float maxHp = 100;
[SerializeField] float hp;
void Start() {
hp = maxHp;
}
public void DealDamage(float damage) {
hp -= damage;
if (hp <= 0) {
FindAnyObjectByType<LevelController>().OnPlayerDie();
}
}
public float GetHp() { return hp; }
}