Ejemplo n.º 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);
    }
Ejemplo n.º 2
0
 public void Hit(int damage)
 {
     mCurrentHP = mCurrentHP - damage;
     if (mCurrentHP <= 0)
     {
         mState     = eEnemyState.Dead;
         mCurrentHP = 0;
     }
     HPBar.ShowGauge(mCurrentHP, MaxHP);
 }
Ejemplo n.º 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());
    }
Ejemplo n.º 4
0
 public void ShowHP(float cur, float max)
 {
     mPlayerGaugeBar.ShowGauge(cur, max);
 }