public void ClosePanel(UIPanelTypes panel)
        {
            var panelHolder = uiPanels.FirstOrDefault(x => x.type == panel);

            panelHolder.uiPanel.SetActive(false);

            if (previousUIPanelController)
            {
                previousUIPanelController.OpenPanel();
                currentUIPanelController  = previousUIPanelController;
                previousUIPanelController = null;
            }
        }
Exemplo n.º 2
0
        public void OpenPanel(UIPanelTypes panel, bool isCache = false)
        {
            var panelHolder = uiPanels.FirstOrDefault(x => x.type == panel);

            panelHolder.uiPanel.SetActive(true);
            var controller = panelHolder.uiPanel.GetComponent <GenericUIPanelController>();

            if (isCache)
            {
                previousUIPanelController = currentUIPanelController;
            }
            currentUIPanelController = controller;
        }