Ejemplo n.º 1
0
    public void Shoot()
    {
        var bulletColided = Physics.OverlapSphere(transform.position, 20).Any(x => x.transform.parent.tag == "bullet");

        if (!bulletColided)
        {
            Bullet newBullet = BulletMan.SpawnBullet();
            if (newBullet != null)
            {
                BulletsShoot++;
                TargetMan.AddShootToTargets();
                newBullet.Shooter            = this;
                newBullet.transform.position = SpawningPoint.transform.position;
                newBullet.Shoot(BulletSpeed, SpawningPoint.transform.forward);
                _deltaTimeShoot = 0;
                _actionShoot    = 1;
            }
        }
    }