private void WaitingAttack() { attackDelayTime += Time.deltaTime; if (maxAttackDelayTime < attackDelayTime) { if (touchingEnemyName != null) { touchingEnemyCharaBase.OnDamage(attackPower); } attackDelayTime = 0; isAttacking = false; } }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Player" && attacking) { //攻撃する playerCB.OnDamage(attackPower); EndAttacking(); } if (collision.gameObject.tag == "Stage" && attacking) { //攻撃終了 EndAttacking(); } }