Use native runtime documents in render UI

This commit is contained in:
Meta Vens 2026-06-29 06:14:38 +01:00
commit 7a298cf95d
5 changed files with 39 additions and 73 deletions

View file

@ -116,8 +116,10 @@ public sealed class AetheriaUnityRenderSplatViewportSource : MonoBehaviour
_nextRefreshTime = Time.unscaledTime + Mathf.Max(0.02f, refreshIntervalSeconds);
try
{
var nextRenderSplatsViewport = ResolveClient()
.State.Reactive<AetheriaRuntimeRenderSplatsViewportDocument>(viewport);
var nextRenderSplatsViewport = AetheriaUnityRuntimeClientProvider
.Reactive<AetheriaRuntimeRenderSplatsViewportDocument>(
viewport,
"unity-render-splat-viewport");
ClearViewportDocument();
_viewport = viewport;
_renderSplatsViewport = nextRenderSplatsViewport;
@ -159,11 +161,4 @@ public sealed class AetheriaUnityRenderSplatViewportSource : MonoBehaviour
Mathf.Approximately(left.MaxY, right.MaxY);
}
private AetheriaClient ResolveClient()
{
return AetheriaUnityRuntimeClientProvider.ResolveClient(
AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory),
"unity-render-splat-viewport");
}
}

View file

@ -69,7 +69,6 @@ public class SchematicDisplay : MonoBehaviour
private EquippedCargoBay[] _cargoBays;
private SchematicDisplayItem[] _schematicItems;
private AetherDrive _aetherDrive;
private string _clientStatePath = "";
private CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot> _catalog;
private CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _playerSettings;
private CultMeshReactiveDocument<AetheriaRuntimeCurrentEntityDocument> _currentEntity;
@ -326,7 +325,8 @@ public class SchematicDisplay : MonoBehaviour
try
{
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
_catalog = AetheriaUnityRuntimeClientProvider
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-schematic-display");
}
catch (Exception ex)
{
@ -342,7 +342,8 @@ public class SchematicDisplay : MonoBehaviour
{
try
{
_playerSettings = ResolveClient().State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
_playerSettings = AetheriaUnityRuntimeClientProvider
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-schematic-display");
}
catch (Exception ex)
{
@ -359,7 +360,8 @@ public class SchematicDisplay : MonoBehaviour
{
try
{
_currentEntity = ResolveClient().State.Reactive<AetheriaRuntimeCurrentEntityDocument>();
_currentEntity = AetheriaUnityRuntimeClientProvider
.Reactive<AetheriaRuntimeCurrentEntityDocument>("unity-schematic-display");
}
catch (Exception ex)
{
@ -370,18 +372,6 @@ public class SchematicDisplay : MonoBehaviour
return _currentEntity?.Current?.Hud ?? new AetheriaRuntimeCurrentEntityHudStatus();
}
private AetheriaClient ResolveClient()
{
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
{
_clientStatePath = stateBoot.StateFilePath;
ClearClientCaches();
}
return AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot, "unity-schematic-display");
}
private string FormatValue(float value)
{
var settings = ResolvePlayerSettings();

View file

@ -101,8 +101,8 @@ public class VolumeCloudRenderer : EffectBase
try
{
_playerSettings = ResolveClient()
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
_playerSettings = AetheriaUnityRuntimeClientProvider
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-volume-cloud-renderer");
}
catch (Exception ex)
{
@ -112,13 +112,6 @@ public class VolumeCloudRenderer : EffectBase
return _playerSettings?.Current;
}
private AetheriaClient ResolveClient()
{
return AetheriaUnityRuntimeClientProvider.ResolveClient(
AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory),
"unity-volume-cloud-renderer");
}
[ImageEffectOpaque]
private void OnRenderImage(RenderTexture source, RenderTexture destination) {
if (cloudShader == null) {

View file

@ -119,7 +119,6 @@ public class ZoneRenderer : MonoBehaviour
Array.Empty<AetheriaRuntimeZoneRenderAsteroidBeltPose>();
private IReadOnlyList<AetheriaRuntimeBodySnapshotCommit> _zoneRenderBodies =
Array.Empty<AetheriaRuntimeBodySnapshotCommit>();
private string _clientStatePath = "";
private CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot> _catalog;
private CultMeshReactiveDocument<AetheriaRuntimeZoneContactsDocument> _zoneContacts;
private AetheriaRuntimeRtsViewportBounds _objectsViewportBounds;
@ -1208,7 +1207,8 @@ public class ZoneRenderer : MonoBehaviour
try
{
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
_catalog = AetheriaUnityRuntimeClientProvider
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-zone-renderer");
}
catch (Exception ex)
{
@ -1225,7 +1225,8 @@ public class ZoneRenderer : MonoBehaviour
try
{
_zoneContacts = ResolveClient().State.Reactive<AetheriaRuntimeZoneContactsDocument>();
_zoneContacts = AetheriaUnityRuntimeClientProvider
.Reactive<AetheriaRuntimeZoneContactsDocument>("unity-zone-renderer");
}
catch (Exception ex)
{
@ -1243,8 +1244,10 @@ public class ZoneRenderer : MonoBehaviour
try
{
var nextObjectsViewport = ResolveClient()
.State.Reactive<AetheriaRuntimeObjectsViewportDocument>(viewportBounds);
var nextObjectsViewport = AetheriaUnityRuntimeClientProvider
.Reactive<AetheriaRuntimeObjectsViewportDocument>(
viewportBounds,
"unity-zone-renderer");
_objectsViewport?.Dispose();
_objectsViewportBounds = viewportBounds;
_objectsViewport = nextObjectsViewport;
@ -1257,20 +1260,6 @@ public class ZoneRenderer : MonoBehaviour
return _objectsViewport?.Current;
}
private AetheriaClient ResolveClient()
{
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
{
_clientStatePath = stateBoot.StateFilePath;
ClearClientCaches();
}
return AetheriaUnityRuntimeClientProvider.ResolveClient(
stateBoot,
"unity-zone-renderer");
}
private void ClearClientCaches()
{
_catalog?.Dispose();