diff --git a/Assets/ScreenSystem/Runtime/Modal/ModalManager.cs b/Assets/ScreenSystem/Runtime/Modal/ModalManager.cs index 2a6b610..db14c84 100644 --- a/Assets/ScreenSystem/Runtime/Modal/ModalManager.cs +++ b/Assets/ScreenSystem/Runtime/Modal/ModalManager.cs @@ -90,6 +90,16 @@ private async UniTaskVoid PushAndForgetInternal(IModalBuilder builder) } public async UniTask Pop(bool playAnimation, CancellationToken cancellationToken) + { + await PopInternal(playAnimation, cancellationToken); + } + + public async UniTask Pop(IModal modal, bool playAnimation, CancellationToken cancellationToken) + { + await PopInternal(playAnimation, cancellationToken, modal.ModalId); + } + + private async UniTask PopInternal(bool playAnimation, CancellationToken cancellationToken, string modalId = null) { if (ModalTransitionScope.IsModalTransition) { @@ -99,7 +109,7 @@ public async UniTask Pop(bool playAnimation, CancellationToken cancellationToken using var scope = ModalTransitionScope.Transition(); if (_modalContainer.Modals.Any()) { - var handle = _modalContainer.Pop(playAnimation); + var handle = string.IsNullOrEmpty(modalId) ? _modalContainer.Pop(playAnimation) : _modalContainer.Pop(playAnimation, modalId); await handle.WithCancellation(cancellationToken); } }