diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 0fac1d98f..a8a674421 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -2543,11 +2543,13 @@ static void RequireDaemonRenderQueryAuthority(string root) var requiredSchematicHudSymbols = new[] { - "private AetheriaRuntimeCurrentEntityDocument _currentEntityDocument;", + "private CultMeshReactiveDocument _currentEntity;", "ResolveCurrentEntityHudStatus()", "AetheriaUnityRuntimeClientProvider.ResolveClient(", ".Current", - ".LatestEntity()", + ".ReactiveEntity()", + "_currentEntity?.Current?.Hud", + "_currentEntity?.Dispose()", "hud.OverrideShutdown", "hud.HeatsinksEnabled", "hud.Heatstroke", diff --git a/Assets/Scripts/UI/HUD/SchematicDisplay.cs b/Assets/Scripts/UI/HUD/SchematicDisplay.cs index d812550e7..81a2524bf 100644 --- a/Assets/Scripts/UI/HUD/SchematicDisplay.cs +++ b/Assets/Scripts/UI/HUD/SchematicDisplay.cs @@ -72,10 +72,8 @@ public class SchematicDisplay : MonoBehaviour private string _clientStatePath = ""; private CultMeshReactiveDocument _catalog; private CultMeshReactiveDocument _playerSettings; + private CultMeshReactiveDocument _currentEntity; private AetheriaRuntimeDaemonRenderSettings? _renderSettings; - private AetheriaRuntimeCurrentEntityDocument _currentEntityDocument; - private float _currentEntityDocumentReadTime = float.NegativeInfinity; - private const float CurrentEntityHudRefreshIntervalSeconds = 0.1f; private bool _enemy; private Entity _player; @@ -360,25 +358,22 @@ public class SchematicDisplay : MonoBehaviour private AetheriaRuntimeCurrentEntityHudStatus ResolveCurrentEntityHudStatus() { - if (_currentEntityDocument == null || - Time.unscaledTime - _currentEntityDocumentReadTime >= CurrentEntityHudRefreshIntervalSeconds) + if (_currentEntity == null) { try { - _currentEntityDocument = ResolveClient() + _currentEntity = ResolveClient() .Aetheria() .Current - .LatestEntity(); + .ReactiveEntity(); } catch (Exception ex) { - Debug.LogWarning($"Failed to read Aetheria current entity HUD status: {ex.Message}"); + Debug.LogWarning($"Failed to bind Aetheria current entity HUD status: {ex.Message}"); } - - _currentEntityDocumentReadTime = Time.unscaledTime; } - return _currentEntityDocument?.Hud ?? new AetheriaRuntimeCurrentEntityHudStatus(); + return _currentEntity?.Current?.Hud ?? new AetheriaRuntimeCurrentEntityHudStatus(); } private AetheriaClient ResolveClient() @@ -425,10 +420,10 @@ public class SchematicDisplay : MonoBehaviour { _catalog?.Dispose(); _playerSettings?.Dispose(); + _currentEntity?.Dispose(); _catalog = null; _playerSettings = null; - _currentEntityDocument = null; - _currentEntityDocumentReadTime = float.NegativeInfinity; + _currentEntity = null; } private void OnDestroy()