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