Expose native Unity runtime state access
This commit is contained in:
parent
870b619157
commit
d10da01a69
10 changed files with 166 additions and 210 deletions
|
|
@ -27,7 +27,6 @@ public class LocalMenu : MonoBehaviour
|
|||
private readonly AetheriaEveUnitySurfaceChrome _surfaceChrome = new AetheriaEveUnitySurfaceChrome();
|
||||
private AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
private AetheriaUnityObservedDockingIndex _observedDockingIndex;
|
||||
private string _clientStatePath = "";
|
||||
|
||||
public void SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
{
|
||||
|
|
@ -224,23 +223,12 @@ public class LocalMenu : MonoBehaviour
|
|||
if (_observedEntityIndex == null)
|
||||
return false;
|
||||
|
||||
dockingIndex = _observedDockingIndex ??= new AetheriaUnityObservedDockingIndex(ResolveClient, _observedEntityIndex);
|
||||
dockingIndex = _observedDockingIndex ??= new AetheriaUnityObservedDockingIndex(
|
||||
() => AetheriaUnityRuntimeClientProvider.RuntimeClient("unity-runtime-local-story"),
|
||||
_observedEntityIndex);
|
||||
return true;
|
||||
}
|
||||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
_observedDockingIndex?.Dispose();
|
||||
_observedDockingIndex = null;
|
||||
}
|
||||
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot, "unity-runtime-local-story");
|
||||
}
|
||||
|
||||
private void HideStorySurface()
|
||||
{
|
||||
if (_surfaceDocument == null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue