예제 #1
0
    private void AttackAI()
    {
        if (!TryGetDirection(out direction))
        {
            return;
        }
        var  ray    = new Ray(this.transform.position, direction);
        bool hitted = Physics.Raycast(ray, out RaycastHit hit, AttackRange);

        if (hitted && (hit.collider.tag == "Player"))
        {
            curWeapon.Shoot(direction);
        }
    }
예제 #2
0
 private void ShotButton_HoldShootNotify(Vector3 direction) =>
 curWeapon.Shoot(direction != Vector3.zero ? direction : ShotDirection);
예제 #3
0
 public override void EntryAction()
 {
     weapon.Shoot();
     animController.SetTrigger("Shoot");
 }