void HandleFloorUIText() { if (GameUI.instance.timerText && timerBox.activeSelf) { timerText.text = GameUI.instance.timerText.text.ToString(); } if (GameUI.instance.barHp && barHpBox.activeSelf) { barHp.UpdateValue(Player.instance.hp, ConstInfo.maxHp); } }
public void DeductHealth(float deductHealth) { playerHealth = playerHealth - deductHealth; int HP = (int)playerHealth; int MaxHP = (int)playerMaxHealth; PlayerHpBar.UpdateValue(HP, MaxHP); HpBar.setHealth(HP); //Debug.Log(playerHealth); if (playerHealth == 0) { PlayerDead(); GameObject death = (GameObject)Instantiate( DeathExplosion, transform.position, transform.rotation); } }
public void DeductHealth(float deductHealth) { enemyHealth = enemyHealth - deductHealth; int HP = (int)enemyHealth; int MaxHP = (int)enemyMaxHealth; EnemyHpBar.UpdateValue(HP, MaxHP); HpBar.setHealth(HP); //Debug.Log(enemyHealth); if (enemyHealth <= 0) { enemyIsDead = true; GameObject enemyExplosion = (GameObject)Instantiate( EnemyExplosion, transform.position, transform.rotation); EnemyDead(); } }
// 게임 UI 업데이트 void HandleGameUI() { HandleGameText(); HandleEffect(); barHp.UpdateValue(Player.instance.hp, ConstInfo.maxHp); }