Keep navigation shutdown on the outgoing Verse
This commit is contained in:
parent
909ce43727
commit
2fd5f4bbb9
3 changed files with 31 additions and 11 deletions
|
|
@ -1172,6 +1172,9 @@ namespace GameCult.Eve.UnityScene.Tests
|
|||
bootstrap.ConfigureProvider(provider);
|
||||
bootstrap.Mount();
|
||||
var originalHost = bootstrap.Host;
|
||||
var deactivationRoutes = new List<string>();
|
||||
var deactivationProbe = bootstrap.SceneRoot!.gameObject.AddComponent<NavigationDeactivationProbe>();
|
||||
deactivationProbe.Deactivated = () => deactivationRoutes.Add(provider.ActiveRoute);
|
||||
|
||||
provider.PublishReceipt(new EveUnitySceneCommandReceipt(
|
||||
"receipt:launch",
|
||||
|
|
@ -1198,6 +1201,7 @@ namespace GameCult.Eve.UnityScene.Tests
|
|||
Assert.That(provider.CommitNavigationCount, Is.EqualTo(1));
|
||||
Assert.That(provider.FinalizeNavigationCount, Is.EqualTo(1));
|
||||
Assert.That(provider.RollbackNavigationCount, Is.Zero);
|
||||
Assert.That(deactivationRoutes, Is.EqualTo(new[] { "original" }));
|
||||
|
||||
provider.PublishReceipt(new EveUnitySceneCommandReceipt(
|
||||
"receipt:launch-again",
|
||||
|
|
@ -3559,5 +3563,15 @@ namespace GameCult.Eve.UnityScene.Tests
|
|||
Reactivated?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NavigationDeactivationProbe : MonoBehaviour
|
||||
{
|
||||
public Action? Deactivated { get; set; }
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Deactivated?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue