Working visual part
This commit is contained in:
@@ -21,6 +21,8 @@ namespace UI.CardSystem
|
||||
[Header("Booster Pack UI")]
|
||||
[SerializeField] private GameObject[] boosterPackButtons;
|
||||
[SerializeField] private BoosterOpeningPage boosterOpeningPage;
|
||||
|
||||
private Input.InputMode _previousInputMode;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -122,6 +124,13 @@ namespace UI.CardSystem
|
||||
else
|
||||
{
|
||||
// Already on page 0 or no book reference, exit
|
||||
// Restore input mode before popping
|
||||
if (Input.InputManager.Instance != null)
|
||||
{
|
||||
Input.InputManager.Instance.SetInputMode(_previousInputMode);
|
||||
Debug.Log($"[AlbumViewPage] Restored input mode to {_previousInputMode} on exit");
|
||||
}
|
||||
|
||||
if (UIPageController.Instance != null)
|
||||
{
|
||||
UIPageController.Instance.PopPage();
|
||||
@@ -160,6 +169,27 @@ namespace UI.CardSystem
|
||||
UIPageController.Instance.PushPage(boosterOpeningPage);
|
||||
}
|
||||
}
|
||||
|
||||
public override void TransitionIn()
|
||||
{
|
||||
// Only store and switch input mode if this is the first time entering
|
||||
// (when _previousInputMode hasn't been set yet)
|
||||
if (Input.InputManager.Instance != null && _previousInputMode == default(Input.InputMode))
|
||||
{
|
||||
// Store the current input mode before switching
|
||||
_previousInputMode = Input.InputMode.GameAndUI;
|
||||
Input.InputManager.Instance.SetInputMode(Input.InputMode.UI);
|
||||
Debug.Log("[AlbumViewPage] Switched to UI-only input mode on first entry");
|
||||
}
|
||||
|
||||
base.TransitionIn();
|
||||
}
|
||||
|
||||
public override void TransitionOut()
|
||||
{
|
||||
// Don't restore input mode here - only restore when actually exiting (in OnExitButtonClicked)
|
||||
base.TransitionOut();
|
||||
}
|
||||
|
||||
protected override void DoTransitionIn(System.Action onComplete)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user