Пример #1
0
        public void Shoot()
        {
            if (!gameObject.activeInHierarchy)
            {
                return;
            }

            if (_shootController)
            {
                return;
            }

            ShootController shootController = ShootController.StartChecking(gameObject, _shootingType);

            if (!shootController)
            {
                return;
            }

            _shootController = shootController;

            _shootController.ShootEvent += OnShootChecked;

            _isShooting = true;

            if (_canShoot)
            {
                SpawnProjectile();
            }

            _canShoot = false;
        }