2026-04-02 타임라인 (진행중)
This commit is contained in:
@@ -1,15 +1,34 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PlayerHealth : Health
|
||||
{
|
||||
[SerializeField] PlayerStat _pstat;
|
||||
|
||||
public Image UI_HPBar { get; private set; }
|
||||
public Image UI_MPBar { get; private set; }
|
||||
public Image UI_StaminaBar { get; private set; }
|
||||
|
||||
public PlayerStat Pstat { get { return _pstat; } }
|
||||
|
||||
void Start()
|
||||
private void Awake()
|
||||
{
|
||||
_pstat = GetComponent<PlayerStat>();
|
||||
currentHp = _pstat.MaxHp; // 스태틱 데이터를 가져와 초기화
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
maxHp = _pstat.MaxHp;
|
||||
currentHp = _pstat.MaxHp;
|
||||
|
||||
UI_HPBar = GameManager.Instance.InGameUI.UserHealth.UI_HPBar;
|
||||
UI_MPBar = GameManager.Instance.InGameUI.UserHealth.UI_MPBar;
|
||||
UI_StaminaBar = GameManager.Instance.InGameUI.UserHealth.UI_StaminaBar;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
UI_HPBar.fillAmount = (float)currentHp / (float)maxHp;
|
||||
}
|
||||
|
||||
public void TakeDamage(int damage)
|
||||
|
||||
Reference in New Issue
Block a user