ui navigation 처리
This commit is contained in:
parent
6350216fec
commit
3decbe16d0
@ -2087,6 +2087,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 6555851050378238242}
|
||||
- component: {fileID: 895343445285308768}
|
||||
- component: {fileID: 1368992355976611131}
|
||||
m_Layer: 5
|
||||
m_Name: RestaurantManagementUi
|
||||
m_TagString: Untagged
|
||||
@ -2133,6 +2134,18 @@ MonoBehaviour:
|
||||
_cookwareCategoryTabs: {fileID: 195952124745473889}
|
||||
_completeBatchFilledImage: {fileID: 4012160685168048845}
|
||||
_holdCompleteTime: 1
|
||||
--- !u!225 &1368992355976611131
|
||||
CanvasGroup:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3049036770990482859}
|
||||
m_Enabled: 1
|
||||
m_Alpha: 1
|
||||
m_Interactable: 1
|
||||
m_BlocksRaycasts: 1
|
||||
m_IgnoreParentGroups: 0
|
||||
--- !u!1 &3260392999935947701
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -7710,6 +7723,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 5810968388153251297}
|
||||
- component: {fileID: 4354590683901102911}
|
||||
- component: {fileID: 8448676306840617674}
|
||||
m_Layer: 5
|
||||
m_Name: ConfirmUi
|
||||
m_TagString: Untagged
|
||||
@ -7753,6 +7767,18 @@ MonoBehaviour:
|
||||
_messageLabelLocalizeStringEvent: {fileID: 454474333795482723}
|
||||
_cancelButton: {fileID: 8075936514757677367}
|
||||
_confirmButton: {fileID: 770991170480152559}
|
||||
--- !u!225 &8448676306840617674
|
||||
CanvasGroup:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8821125485568642200}
|
||||
m_Enabled: 1
|
||||
m_Alpha: 1
|
||||
m_Interactable: 1
|
||||
m_BlocksRaycasts: 1
|
||||
m_IgnoreParentGroups: 0
|
||||
--- !u!1 &8845694206544237833
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -5,12 +5,14 @@ namespace DDD
|
||||
{
|
||||
public abstract class BaseUi : MonoBehaviour
|
||||
{
|
||||
protected CanvasGroup _canvasGroup;
|
||||
protected GameObject _panel;
|
||||
public virtual bool IsBlockingTime => false;
|
||||
public virtual bool IsOpen => _panel.activeSelf;
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
_canvasGroup = GetComponent<CanvasGroup>();
|
||||
_panel = transform.Find(CommonConstants.Panel).gameObject;
|
||||
}
|
||||
|
||||
@ -35,5 +37,11 @@ protected virtual void TryUnregister() { }
|
||||
|
||||
public virtual void OpenPanel() => _panel.SetActive(true);
|
||||
public virtual void ClosePanel() => _panel.SetActive(false);
|
||||
|
||||
public virtual void SetUiInteractable(bool active)
|
||||
{
|
||||
_canvasGroup.interactable = active;
|
||||
_canvasGroup.blocksRaycasts = active;
|
||||
}
|
||||
}
|
||||
}
|
@ -18,7 +18,6 @@ public class ConfirmUi : PopupUi<RestaurantUiActions>
|
||||
private Action _onCancel;
|
||||
private Action _onConfirm;
|
||||
|
||||
// TODO : 마지막 팝업에서만 NAVIGATION
|
||||
protected override GameObject GetInitialSelected()
|
||||
{
|
||||
return _confirmButton.gameObject;
|
||||
@ -58,8 +57,7 @@ public override void Open(OpenPopupUiEvent evt)
|
||||
_cancelButton.gameObject.SetActive(evt.IsCancelButtonVisible);
|
||||
}
|
||||
|
||||
|
||||
// TODO : 두 팝업 사이의 문제 해결
|
||||
|
||||
protected override bool OnInputPerformed(RestaurantUiActions actionEnum, InputAction.CallbackContext context)
|
||||
{
|
||||
if (base.OnInputPerformed(actionEnum, context) == false) return false;
|
||||
|
@ -162,7 +162,6 @@ private void OnSectionTabSelected(RestaurantManagementSectionType section)
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(section), section, null);
|
||||
}
|
||||
// TODO : 추후 Menu, Cookware, Worker에 맞춰 다른 콘텐츠 노출 처리
|
||||
}
|
||||
|
||||
private void OnCategoryTabSelected(InventoryCategoryType category)
|
||||
|
@ -106,6 +106,8 @@ public void PushPopup(BasePopupUi popup)
|
||||
}
|
||||
|
||||
_popupStack.Push(popup);
|
||||
|
||||
UpdatePopupCanvasGroups();
|
||||
}
|
||||
|
||||
public void PopPopup(BasePopupUi popup)
|
||||
@ -134,6 +136,19 @@ public void PopPopup(BasePopupUi popup)
|
||||
{
|
||||
InputManager.Instance.SwitchCurrentActionMap(_previousActionMap);
|
||||
}
|
||||
|
||||
UpdatePopupCanvasGroups();
|
||||
}
|
||||
|
||||
private void UpdatePopupCanvasGroups()
|
||||
{
|
||||
if (_popupStack.Count == 0) return;
|
||||
|
||||
foreach (var popupUi in _popupStack)
|
||||
{
|
||||
bool isTop = IsTopPopup(popupUi);
|
||||
popupUi.SetUiInteractable(isTop);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user