diff --git a/src/AcDream.App/Streaming/GpuWorldState.cs b/src/AcDream.App/Streaming/GpuWorldState.cs index 2965b24..b0524ed 100644 --- a/src/AcDream.App/Streaming/GpuWorldState.cs +++ b/src/AcDream.App/Streaming/GpuWorldState.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Numerics; +using AcDream.App.Rendering.Vfx; using AcDream.App.Rendering.Wb; using AcDream.Core.World; @@ -41,6 +42,7 @@ public sealed class GpuWorldState { private readonly LandblockSpawnAdapter? _wbSpawnAdapter; private readonly EntitySpawnAdapter? _wbEntitySpawnAdapter; + private readonly EntityScriptActivator? _entityScriptActivator; /// /// Phase Post-A.5 #53 (Task 12): optional callback fired before @@ -57,11 +59,13 @@ public sealed class GpuWorldState public GpuWorldState( LandblockSpawnAdapter? wbSpawnAdapter = null, EntitySpawnAdapter? wbEntitySpawnAdapter = null, - System.Action? onLandblockUnloaded = null) + System.Action? onLandblockUnloaded = null, + EntityScriptActivator? entityScriptActivator = null) { _wbSpawnAdapter = wbSpawnAdapter; _wbEntitySpawnAdapter = wbEntitySpawnAdapter; _onLandblockUnloaded = onLandblockUnloaded; + _entityScriptActivator = entityScriptActivator; } private readonly Dictionary _loaded = new(); @@ -283,6 +287,7 @@ public sealed class GpuWorldState // Phase N.4 Task 17: release per-instance state for server-spawned // entities. No-op for atlas-tier entities (never registered). _wbEntitySpawnAdapter?.OnRemove(serverGuid); + _entityScriptActivator?.OnRemove(serverGuid); bool rebuiltLoaded = false; @@ -343,6 +348,7 @@ public sealed class GpuWorldState // per-instance adapter. Atlas-tier entities (ServerGuid == 0) are // skipped by OnCreate — it returns null immediately for those. _wbEntitySpawnAdapter?.OnCreate(entity); + _entityScriptActivator?.OnCreate(entity); uint canonicalLandblockId = (landblockId & 0xFFFF0000u) | 0xFFFFu;