Add subtitle UI for voice playback
This commit is contained in:
@@ -79,18 +79,25 @@ namespace BriarQueen.UI.Menus
|
||||
|
||||
public bool IsModal => true;
|
||||
public WindowType WindowType => WindowType.PauseMenuWindow;
|
||||
|
||||
private void TryRegisterRaycaster()
|
||||
{
|
||||
if (_raycasterRegistered)
|
||||
return;
|
||||
public UIPauseBehavior PauseBehavior => UIPauseBehavior.TreatAsBackRequest;
|
||||
|
||||
public bool CanSuspendFor(WindowType incomingWindowType)
|
||||
{
|
||||
return incomingWindowType == WindowType.SettingsWindow;
|
||||
}
|
||||
|
||||
private void EnsureExclusiveRaycaster()
|
||||
{
|
||||
if (_interactManager == null || _graphicRaycaster == null)
|
||||
return;
|
||||
|
||||
_interactManager.AddUIRaycaster(_graphicRaycaster);
|
||||
if (!_raycasterRegistered)
|
||||
{
|
||||
_interactManager.AddUIRaycaster(_graphicRaycaster);
|
||||
_raycasterRegistered = true;
|
||||
}
|
||||
|
||||
_interactManager.SetExclusiveRaycaster(_graphicRaycaster);
|
||||
_raycasterRegistered = true;
|
||||
}
|
||||
|
||||
private void TryUnregisterRaycaster()
|
||||
@@ -102,7 +109,7 @@ namespace BriarQueen.UI.Menus
|
||||
return;
|
||||
|
||||
_interactManager.RemoveUIRaycaster(_graphicRaycaster);
|
||||
_interactManager.ClearExclusiveRaycaster();
|
||||
_interactManager.ReleaseExclusiveRaycaster(_graphicRaycaster);
|
||||
_raycasterRegistered = false;
|
||||
}
|
||||
|
||||
@@ -149,7 +156,7 @@ namespace BriarQueen.UI.Menus
|
||||
SetLevelName();
|
||||
|
||||
gameObject.SetActive(true);
|
||||
TryRegisterRaycaster();
|
||||
EnsureExclusiveRaycaster();
|
||||
|
||||
_canvasGroup.blocksRaycasts = false;
|
||||
_canvasGroup.interactable = false;
|
||||
@@ -233,6 +240,7 @@ namespace BriarQueen.UI.Menus
|
||||
public async UniTask ResumeFromOverlay()
|
||||
{
|
||||
StopAndResetCancellation();
|
||||
EnsureExclusiveRaycaster();
|
||||
|
||||
_buttonsGroup.blocksRaycasts = true;
|
||||
_buttonsGroup.interactable = true;
|
||||
|
||||
Reference in New Issue
Block a user