private void Fire(BaseEnemy enemy) { TowerBullet bullet = BulletPool.GetBullet(); bullet.FireToEnemy(this, enemy); _currentFireCooldown = 1 / _fireSpeed; _enableToFire = false; }
//попадание в цель private void HitTarget() { if (_isTargetAlive) { _tower.DealDamage(_enemy); _enemy.OnDeath -= DeathTarget; } _isFired = false; BulletPool.ReleaseBullet(this); }
private void Awake() { _instance = this; BulletPool.InitPool(_bulletPrefab); }