예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        mCurrentHP = MaxHP;
        HPbar.ShowGauge(mCurrentHP, MaxHP);

        mAnim    = GetComponent <Animator>();
        mRB2D    = GetComponent <Rigidbody2D>();
        mbGround = true;
        attackArea.SetTargetTag(TargetName);
        attackArea.SetDamage(AttackPower);
    }
예제 #2
0
 public void Hit(int damage)
 {
     mCurrentHP = mCurrentHP - damage;
     if (mCurrentHP <= 0)
     {
         mState     = eEnemyState.Dead;
         mCurrentHP = 0;
     }
     HPBar.ShowGauge(mCurrentHP, MaxHP);
 }
예제 #3
0
    // Start is called before the first frame update
    void Start()
    {
        HPBar      = HPBarPool.GetFromPool();
        mCurrentHP = MaxHP;
        HPBar.ShowGauge(mCurrentHP, MaxHP);

        mRB2D = GetComponent <Rigidbody2D>();
        mAnim = GetComponent <Animator>();

        mState = eEnemyState.Idle;
        StartCoroutine(AI());
    }
예제 #4
0
 public void ShowHP(float cur, float max)
 {
     mPlayerGaugeBar.ShowGauge(cur, max);
 }