예제 #1
0
 void AttackInput()
 {
     if (Input.GetButton(KeyAttack))
     {
         mBox.Attack();
     }
 }
예제 #2
0
    void GoAttack()
    {
        if (attackCDCount < attackCD)
        {
            return;
        }

        if (chasing != null && isChase)
        {
            float d = Vector3.Distance(chasing.transform.position, transform.position);
            if (d <= 0.8f)
            {
                Debug.Log("Attack");
                monster.Attack();
                attackCDCount = 0;
            }
        }
    }