Expose native Unity runtime state access
This commit is contained in:
parent
870b619157
commit
d10da01a69
10 changed files with 166 additions and 210 deletions
|
|
@ -57,6 +57,43 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
string.IsNullOrWhiteSpace(runtimeId) ? stateBoot.RuntimeId : runtimeId);
|
||||
}
|
||||
|
||||
public static AetheriaClient RuntimeClient(string runtimeId = "")
|
||||
{
|
||||
return ResolveClient(AetheriaUnityRuntimePaths.RuntimeStateFilePath, runtimeId);
|
||||
}
|
||||
|
||||
public static AetheriaClientState RuntimeState(string runtimeId = "")
|
||||
{
|
||||
return RuntimeClient(runtimeId).State;
|
||||
}
|
||||
|
||||
public static AetheriaControl Control(string runtimeId = "")
|
||||
{
|
||||
return RuntimeClient(runtimeId).Control;
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<TDocument> Reactive<TDocument>(string runtimeId = "")
|
||||
where TDocument : class
|
||||
{
|
||||
return RuntimeState(runtimeId).Reactive<TDocument>();
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<TDocument> Reactive<TDocument>(
|
||||
AetheriaRuntimeRtsViewportBounds viewport,
|
||||
string runtimeId = "")
|
||||
where TDocument : class
|
||||
{
|
||||
return RuntimeState(runtimeId).Reactive<TDocument>(viewport);
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<TDocument> Reactive<TDocument>(
|
||||
int index,
|
||||
string runtimeId = "")
|
||||
where TDocument : class
|
||||
{
|
||||
return RuntimeState(runtimeId).Reactive<TDocument>(index);
|
||||
}
|
||||
|
||||
public static AetheriaClient CurrentClientForStateFile(string stateFilePath)
|
||||
{
|
||||
foreach (var pair in RuntimeClients)
|
||||
|
|
@ -94,8 +131,7 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
{
|
||||
try
|
||||
{
|
||||
_playerSettingsDocument ??= ResolveClient(AetheriaUnityRuntimePaths.RuntimeStateFilePath)
|
||||
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
_playerSettingsDocument ??= Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
|
||||
var stored = _playerSettingsDocument.Current;
|
||||
if (stored == null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue