示例#1
0
        void UpdateBottomButtonState(MG_GamePanelType clickbuttonType)
        {
            switch (clickbuttonType)
            {
            case MG_GamePanelType.DicePanel:
                img_scratchbutton.sprite = sp_scratchOff;
                img_dicebutton.sprite    = sp_diceOn;
                img_slotsbutton.sprite   = sp_slotsOff;
                img_wheelbutton.sprite   = sp_wheelOff;
                break;

            case MG_GamePanelType.ScratchPanel:
                img_scratchbutton.sprite = sp_scratchOn;
                img_dicebutton.sprite    = sp_diceOff;
                img_slotsbutton.sprite   = sp_slotsOff;
                img_wheelbutton.sprite   = sp_wheelOff;
                break;

            case MG_GamePanelType.SlotsPanel:
                img_scratchbutton.sprite = sp_scratchOff;
                img_dicebutton.sprite    = sp_diceOff;
                img_slotsbutton.sprite   = sp_slotsOn;
                img_wheelbutton.sprite   = sp_wheelOff;
                break;

            case MG_GamePanelType.WheelPanel:
                img_scratchbutton.sprite = sp_scratchOff;
                img_dicebutton.sprite    = sp_diceOff;
                img_slotsbutton.sprite   = sp_slotsOff;
                img_wheelbutton.sprite   = sp_wheelOn;
                break;
            }
        }
示例#2
0
        public void ShowMGPanel(MG_GamePanelType startShowPanel = MG_GamePanelType.DicePanel)
        {
            canvasGroup.alpha          = 1;
            canvasGroup.blocksRaycasts = true;
            if (!hasShow)
            {
                hasShow = true;
                MG_UIManager.Instance.ShowMenuPanel(startShowPanel);
            }
            else
            {
                switch (startShowPanel)
                {
                case MG_GamePanelType.DicePanel:
                    MG_UIManager.Instance.MenuPanel.OnDiceButtonClick();
                    break;

                case MG_GamePanelType.ScratchPanel:
                    MG_UIManager.Instance.MenuPanel.OnScratchButtonClick();
                    break;

                case MG_GamePanelType.SlotsPanel:
                    MG_UIManager.Instance.MenuPanel.OnSlotsButtonClick();
                    break;

                case MG_GamePanelType.WheelPanel:
                    MG_UIManager.Instance.MenuPanel.OnWheelButtonClick();
                    break;
                }
            }
        }
示例#3
0
        public void ShowMGPanel(MG_GamePanelType startShowPanel = MG_GamePanelType.DicePanel)
        {
            if (!go_BG.activeSelf)
            {
                go_BG.SetActive(true);
            }
            switch (startShowPanel)
            {
            case MG_GamePanelType.DicePanel:
                MG_UIManager.Instance.MenuPanel.OnDiceOutButtonClick();
                break;

            case MG_GamePanelType.ScratchPanel:
                MG_UIManager.Instance.MenuPanel.OnScratchOutButtonClick();
                break;

            case MG_GamePanelType.SlotsPanel:
                MG_UIManager.Instance.MenuPanel.OnSlotsOutButtonClick();
                break;

            case MG_GamePanelType.WheelPanel:
                MG_UIManager.Instance.MenuPanel.OnWheelOutButtonClick();
                break;
            }
        }
示例#4
0
 public bool ShowMenuPanel(MG_GamePanelType startPanel)
 {
     if (MenuPanel is null)
     {
         MG_SaveManager.Current_GamePanel = (int)startPanel;
         MenuPanel = Instantiate(Resources.Load <GameObject>(MenuPanelPath), MenuPanelRoot).GetComponent <MG_MenuPanel>();
         StartCoroutine(MenuPanel.OnEnter());
         ShowGamePanel(startPanel);
         return(true);
     }
     Debug.LogWarning("Show MG_MenuPanel Error : panel has show.");
     return(false);
 }
示例#5
0
        public bool ShowGamePanel(MG_GamePanelType _PanelType)
        {
            int panelIndex = (int)_PanelType;

            MG_SaveManager.Current_GamePanel = panelIndex;
            if (LoadedPanel_Dic.TryGetValue(panelIndex, out MG_UIBase loadedGamePanel))
            {
                if (loadedGamePanel is null)
                {
                    Debug.LogWarning("Show MG_GamePanel-" + _PanelType + " Error : loadedDic has key , but content is null.");
                    return(false);
                }
                if (Current_GamePanel == loadedGamePanel)
                {
                    //Debug.LogWarning("Show MG_GamePanel-" + _PanelType + " Error : panel has show.");
                    return(false);
                }
                if (Current_GamePanel is object)
                {
                    StartCoroutine(Current_GamePanel.OnExit());
                }
                StartCoroutine(loadedGamePanel.OnEnter());
                Current_GamePanel = loadedGamePanel;
            }
            else
            {
                if (Type_Path_Dic.TryGetValue(panelIndex, out string panelPath))
                {
                    if (string.IsNullOrEmpty(panelPath))
                    {
                        Debug.LogWarning("Show MG_GamePanel-" + _PanelType + " Error : panelPathDic content is null or empty.");
                        return(false);
                    }
                    MG_UIBase nextShowPanel = Instantiate(Resources.Load <GameObject>(panelPath), GamePanelRoot).GetComponent <MG_UIBase>();
                    if (Current_GamePanel is object)
                    {
                        StartCoroutine(Current_GamePanel.OnExit());
                    }
                    nextShowPanel.transform.SetAsLastSibling();
                    StartCoroutine(nextShowPanel.OnEnter());
                    LoadedPanel_Dic.Add(panelIndex, nextShowPanel);
                    Current_GamePanel = nextShowPanel;
                }
                else
                {
                    Debug.LogWarning("Show MG_GamePanel-" + _PanelType + " Error : panelPathDic content is null or empty.");
                    return(false);
                }
            }
            return(true);
        }