コード例 #1
0
 void AttackInput()
 {
     if (Input.GetButton(KeyAttack))
     {
         mBox.Attack();
     }
 }
コード例 #2
0
ファイル: Monster1.cs プロジェクト: clotha87762/SurvivorQQQ
    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;
            }
        }
    }