Example #1
0
 private void openCommonUi(UiBase ui, Action completeCb)
 {
     commonUis.AddLast(ui);
     ui.transform.SetParent(fullScreenRoot);
     ui.transform.SetAsLastSibling();
     ui.Open(onCommonUiClose, completeCb);
 }
Example #2
0
        private void openPopUpWindow(UiBase ui, Action completeCb)
        {
            if (popUpWindows.Contains(ui))
            {
                completeCb?.Invoke();
                return;
            }

            frontMask.SetFrontMask(DefaultFrontMaskAlpha, true); // TODO: Read setting in windows.
            frontMask.transform.SetAsLastSibling();
            ui.transform.SetParent(popUpWindowRoot);
            ui.transform.SetAsLastSibling();
            ui.Open(onPopUpWindowClose, completeCb);
            popUpWindows.AddLast(ui);
            popUpWindowRoot.gameObject.SetActive(true);
        }
Example #3
0
        private void openFullScreenCanvas(UiBase ui, Action completeCb)
        {
            if (fullScreenCavases.Contains(ui))
            {
                debug.PrintSystem.LogWarning($"[MainCanvasRoot] UI has already open. UI: {ui.name}");
                completeCb?.Invoke();
                return;
            }

            if (fullScreenCavases.Count == 0 || fullScreenCavases.Last.Value.State == UiState.US_HIDE)
            {
                fullScreenCavases.AddLast(ui);
                ui.transform.SetParent(fullScreenRoot);
                ui.transform.SetAsFirstSibling();
                ui.Open(onFullScreenCanvasClose, completeCb);
                return;
            }

            fullScreenCavases.Last.Value.Hide(() => openFullScreenCanvas(ui, completeCb));
        }