using GameCore.ECS; using GameCore.ECS.Interfaces; using GameCore.Events; namespace GameCore.Combat; public class ProjectileInitializationSystem : ISystem { private readonly World _world; public ProjectileInitializationSystem(World world) { _world = world; _world.Subscribe(OnEntitySpawned); } public void Update(World world, float deltaTime) { } private void OnEntitySpawned(EntitySpawnedEvent e) { var projComp = _world.GetComponent(e.NewEntity); if (projComp == null) return; var ownerWeapon = _world.GetComponent(e.Owner); if (ownerWeapon != null) { projComp.Owner = e.Owner; projComp.OnHitEffects = ownerWeapon.OnHitEffects; } } }