예제 #1
0
 private void Update()
 {
     if (m_fAppearTime > 0)
     {
         m_fAppearTime -= Time.deltaTime;
     }
     if (m_bAppear == false && m_fAppearTime <= 0)
     {
         m_bAppear = true;
         m_animator.SetBool(m_hashBAppear, true);
         m_monsterHpBar.transform.gameObject.SetActive(true);
     }
     m_monsterHpBar.SetHPBar(m_monsterInfo);
     m_monsterHpBar.SetHpBarDirection(this.transform.localScale.x);
     // 다시볼것
     if (m_animFunction.GetCurrntAnimClipName() == "hit")
     {
         m_monsterAttack.m_bAttack = false;
     }
 }
예제 #2
0
    protected virtual IEnumerator CheckHP()
    {
        if (m_monsterRank == MONSTER_RANK.MONSTER_NORMAL)
        {
            m_monsterHpBar.transform.gameObject.SetActive(true);
            while (true)
            {
                m_monsterHpBar.SetHPBar(m_monsterInfo);
                m_monsterHpBar.SetHpBarDirection(this.transform.localScale.x);
                if (nowState == ENEMY_STATE.DIE)
                {
                    WorkUpdateHpBar.KillCoroutine();
                }
                yield return(null);
            }
        }
        else
        {
            m_bossHpBar.transform.gameObject.SetActive(true);
            m_bossHpBar.InitInfo();
            m_bossHpBar.iCurValue = m_monsterInfo.GetHP() / 300;
            m_bossHpBar.SetText();
            m_bossHpBar.iCurValue--;
            while (true)
            {
                //
                float temp = m_monsterInfo.GetHP() / 300;
                temp -= 1;
                if (m_monsterInfo.GetHP() % 300 > 0.0f)
                {
                    temp++;
                }

                if (m_bossHpBar.iCurValue > temp && m_bossHpBar.bLastHp == false)
                {
                    m_bossHpBar.SetHPBar(300, 0);
                    m_bossHpBar.ChangeHpBar();
                    m_bossHpBar.HpZero();
                    m_bossHpBar.ResetHpBar();
                    m_bossHpBar.iCurValue = (int)temp;
                }

                if (temp > -1)
                {
                    m_bossHpBar.SetHPBar(300, m_monsterInfo.GetHP() - temp * 300);
                }
                else
                {
                    m_bossHpBar.SetHPBar(300, 0);
                    m_bossHpBar.HpZero();
                }

                if (m_monsterInfo.GetHP() / 300 == 0)
                {
                    m_bossHpBar.bLastHp = true;
                }

                if (nowState == ENEMY_STATE.DIE)
                {
                    WorkUpdateHpBar.KillCoroutine();
                    m_bossHpBar.EndBossUI();
                }

                m_bossHpBar.SetArmorBar(m_fMaxArmorPoint, m_fArmorPoint);
                CheckArmorBreak();
                yield return(null);
            }
        }
    }