ui 구조 수정
This commit is contained in:
parent
523b54cf16
commit
5406610fe7
@ -7,6 +7,13 @@ public abstract class BasePopupUi : BaseUi
|
||||
{
|
||||
public abstract InputActionMaps InputActionMaps { get; }
|
||||
protected abstract GameObject GetInitialSelected();
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
_enableBlockImage = true;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
|
@ -6,21 +6,25 @@ namespace DDD
|
||||
public abstract class BaseUi : MonoBehaviour
|
||||
{
|
||||
protected CanvasGroup _canvasGroup;
|
||||
protected GameObject _blockImage;
|
||||
protected GameObject _panel;
|
||||
public virtual bool IsBlockingTime => false;
|
||||
public virtual bool IsOpen => _panel.activeSelf;
|
||||
|
||||
[SerializeField] protected bool _enableBlockImage;
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
_canvasGroup = GetComponent<CanvasGroup>();
|
||||
_panel = transform.Find(CommonConstants.Panel).gameObject;
|
||||
_blockImage = transform.Find(CommonConstants.BlockImage).gameObject;
|
||||
}
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
TryRegister();
|
||||
@ -29,24 +33,41 @@ protected virtual void Start()
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected virtual void OnDisable()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
{
|
||||
TryUnregister();
|
||||
}
|
||||
|
||||
|
||||
protected virtual void TryRegister() { }
|
||||
protected virtual void TryUnregister() { }
|
||||
|
||||
public virtual void OpenPanel() => _panel.SetActive(true);
|
||||
public virtual void ClosePanel() => _panel.SetActive(false);
|
||||
public virtual void OpenPanel()
|
||||
{
|
||||
if (_enableBlockImage)
|
||||
{
|
||||
_blockImage.SetActive(true);
|
||||
}
|
||||
|
||||
_panel.SetActive(true);
|
||||
}
|
||||
|
||||
public virtual void ClosePanel()
|
||||
{
|
||||
if (_enableBlockImage)
|
||||
{
|
||||
_blockImage.SetActive(false);
|
||||
}
|
||||
|
||||
_panel.SetActive(false);
|
||||
}
|
||||
|
||||
public virtual void SetUiInteractable(bool active)
|
||||
{
|
||||
|
@ -8,6 +8,7 @@ public static class CommonConstants
|
||||
public const string BaseRestaurantEnvironment = "BaseRestaurantEnvironment";
|
||||
public const string Clone = "(Clone)";
|
||||
public const string Panel = "Panel";
|
||||
public const string BlockImage = "BlockImage";
|
||||
}
|
||||
|
||||
public static class DataConstants
|
||||
|
Loading…
Reference in New Issue
Block a user