2026-03-30 아이템 사용 진행중
This commit is contained in:
@@ -2,17 +2,16 @@
|
||||
|
||||
public class PlayerHealth : Health
|
||||
{
|
||||
private PlayerStat _pstat;
|
||||
public int currentHp;
|
||||
[SerializeField] private PlayerStat _pstat;
|
||||
|
||||
void Start()
|
||||
{
|
||||
_pstat = GetComponent<PlayerStat>();
|
||||
//currentHp = _pstat.MaxHp; // 스태틱 데이터를 가져와 초기화
|
||||
currentHp = _pstat.MaxHp; // 스태틱 데이터를 가져와 초기화
|
||||
}
|
||||
|
||||
public void TakeDamage(int damage)
|
||||
{
|
||||
|
||||
ChangeHP(currentHp - Mathf.Clamp(damage,0,currentHp));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user