Пример #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");
 }