DEG-143[Feat] 강화에 따른 하트 추가

씬 통합 전까지 오류가 뜰 예정이라 일단 주석처리 했습니다.
This commit is contained in:
99jamin 2025-05-13 14:19:02 +09:00
parent 90a58c832a
commit 6704db4e0c
3 changed files with 30 additions and 7 deletions

View File

@ -86,9 +86,12 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
PlayerInit();
//강화 수치 적용
attackPowerLevel = 1 + (float)UpgradeManager.Instance.upgradeStat.CurrentUpgradeLevel(StatType.AttackPower) / 2;
moveSpeedLevel = 1 + (float)UpgradeManager.Instance.upgradeStat.CurrentUpgradeLevel(StatType.MoveSpeed) / 2;
dashCoolLevel = (float)UpgradeManager.Instance.upgradeStat.CurrentUpgradeLevel(StatType.DashCoolDown)/4;
//attackPowerLevel = 1 + (float)UpgradeManager.Instance.upgradeStat.CurrentUpgradeLevel(StatType.AttackPower) / 2;
attackPowerLevel = 1.5f;
//moveSpeedLevel = 1 + (float)UpgradeManager.Instance.upgradeStat.CurrentUpgradeLevel(StatType.MoveSpeed) / 2;
moveSpeedLevel = 1.5f;
//dashCoolLevel = (float)UpgradeManager.Instance.upgradeStat.CurrentUpgradeLevel(StatType.DashCoolDown)/4;
dashCoolLevel = 0.25f;
attackPower *= attackPowerLevel;
moveSpeed *= moveSpeedLevel;

View File

@ -9,7 +9,27 @@ public class DungeonPanelController : MonoBehaviour
[SerializeField] private Slider _bossHealthBar; // 0~1 value
[SerializeField] private Image[] _playerHealthImages; // color 값 white / black 로 조정
private int _countHealth = 0;
private int visibleHeartCount = 3; // 강화 레벨로 설정됨
void Start()
{
//int level = UpgradeManager.Instance.upgradeStat.CurrentUpgradeLevel(StatType.Heart); // 1~3
int level = 2;
visibleHeartCount = 3 + (level - 1); // level 1=3개, 2=4개, 3=5개
for (int i = 0; i < _playerHealthImages.Length; i++)
{
var color = _playerHealthImages[i].color;
color.a = (i < visibleHeartCount) ? 1f : 0f;
color = (i < visibleHeartCount) ? Color.white : new Color(1,1,1,0);
_playerHealthImages[i].color = color;
}
_countHealth = 0;
}
public void SetBossHealthBar(float hp) // hp: 0~100
{
float normalizedHp = hp / 100f; // 0~1 사이 값으로 조정
@ -21,11 +41,11 @@ public class DungeonPanelController : MonoBehaviour
{
StartCoroutine(WaitForOneSecond());
// out of index error 방지
if (_countHealth > _playerHealthImages.Length - 1) return false;
if (_countHealth >= visibleHeartCount) return false;
_playerHealthImages[_countHealth].color = Color.black;
_countHealth++;
return _countHealth <= _playerHealthImages.Length - 1;
return _countHealth < visibleHeartCount;
}
IEnumerator WaitForOneSecond()

BIN
Assets/KSH/ReDungeon.unity (Stored with Git LFS)

Binary file not shown.