Esempio n. 1
0
        public void HideCurrentPanelPotentialResourceChanges()
        {
            if (currentPanel == null)
            {
                return;
            }

            currentPanel.HidePotentialResourceChanges();
        }
Esempio n. 2
0
        public void SwapDelay(ResourcePanelType panelType, Action extraCallBack = null)
        {
            if (TransitionManager.GetInstance.currentSceneManager.sceneType == SceneType.Battlefield)
            {
                return;
            }
            switch (panelType)
            {
            case ResourcePanelType.overhead:
                overheadPanel.gameObject.SetActive(true);
                sidePanel.gameObject.SetActive(false);
                bottomPanel.gameObject.SetActive(false);
                overheadPanel.InitializeData();
                overheadPanel.myPanel.PlayOpenAnimation();
                currentPanel = overheadPanel;
                break;

            case ResourcePanelType.side:
                sidePanel.gameObject.SetActive(true);
                overheadPanel.gameObject.SetActive(false);
                bottomPanel.gameObject.SetActive(false);
                sidePanel.InitializeData();
                sidePanel.myPanel.PlayOpenAnimation();
                currentPanel = sidePanel;
                break;

            case ResourcePanelType.bottom:
                bottomPanel.gameObject.SetActive(true);
                sidePanel.gameObject.SetActive(false);
                overheadPanel.gameObject.SetActive(false);
                bottomPanel.InitializeData();
                bottomPanel.myPanel.PlayOpenAnimation();
                currentPanel = bottomPanel;
                break;

            default:
                break;
            }

            currentPanel.isShowing = true;

            currentPanel.foodControl.ShowWarning();
            currentPanel.coinControl.ShowWarning();
            currentPanel.troopControl.ShowWarning();
            currentPanel.villagerControl.ShowWarning();
            currentPanel.HidePotentialResourceChanges();
            if (extraCallBack != null)
            {
                extraCallBack();
            }

            UpdateCurrentPanel();
        }