Use native runtime documents in render UI
This commit is contained in:
parent
d10da01a69
commit
7a298cf95d
5 changed files with 39 additions and 73 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue