示例#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;
            }
        }
    }