protected void BaseBuild(Transform firePoint, IEnemy enemy) { GameObject prefabObject = Object.Instantiate(ProjectilePreferences.ProjectilePrefab, Vector3.zero, ProjectilePreferences.ProjectilePrefab.transform.rotation); TurretProjectileAbs cannonProjectile = ProjectileInstance; cannonProjectile.SetGameObject(prefabObject); cannonProjectile.SetProjectilePreferences(ProjectilePreferences); cannonProjectile.SetFirePoint(firePoint); cannonProjectile.SetTarget(enemy); cannonProjectile.SetLookRotation(enemy.GetTransform()); cannonProjectile.SetSelfDestruct(ProjectilePreferences.SelfDestructAfter); cannonProjectile.CountDistance(); _turretProjectileController.AddShell(cannonProjectile); }
public void AddShell(TurretProjectileAbs tpa) => _turretProjectiles.Add(tpa);