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

            EndAttacking();
        }
        if (collision.gameObject.tag == "Stage" && attacking)
        {
            //攻撃終了
            EndAttacking();
        }
    }