예제 #1
0
 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);
     }
 }
예제 #2
0
    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);
        }
    }
예제 #3
0
    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();
        }
    }
예제 #4
0
 // 게임 UI 업데이트
 void HandleGameUI()
 {
     HandleGameText();
     HandleEffect();
     barHp.UpdateValue(Player.instance.hp, ConstInfo.maxHp);
 }