Beispiel #1
0
    public void Damage(int power)
    {
        this.CurrHP -= power;
        blink.BlinkStart();

        if (CurrHP <= 0)
        {
            Dead();
        }
    }
Beispiel #2
0
    //데미지받는것
    public void Damage(int power)
    {
        onDamagedCount   += power;
        this.CurrHP      -= power;
        BossHp.fillAmount = (float)this.CurrHP / this.MaxHP;
        blink.BlinkStart();

        if (CurrHP <= 0)
        {
            //보스hp가 0이하가 되면 ResultManager에서 true호출하여 게임을 종료시킴
            ResultManager.Instance.GameSet(true);
        }
    }
Beispiel #3
0
    // 피격
    private void OnTriggerEnter(Collider other)
    {
        if (HP <= 0)
        {
            return;          // 이미 죽음
        }
        if (InvincibleTimeCount != 0)
        {
            return;                           // 무적시간
        }
        // 적 총알일 경우
        if (other.tag.Equals("E_Bullet"))
        {
            // 체력 깎임
            if (GodMode == false)
            {
                HP--;
            }

            // 깜빡임
            DamageBlink.BlinkStart();

            // 무적 시간 시작
            InvincibleTimeCount += Time.deltaTime;

            // 이미지 변경
            if (GodMode == false)
            {
                HP_Sprite[HP].sprite = DamageHPSprite;
            }

            // 죽음
            if (HP <= 0)
            {
                ResultManager.Instance.GameSet(false);
            }
        }
    }