Пример #1
0
    /// <summary> 显示并刷新特定类别的UI </summary>
    private void ShowUI(GameUIType gameUIType)
    {
        switch (gameUIType)
        {
        case GameUIType.Fight:
            fightP.gameObject.SetActive(true);
            //TODO
            break;

        case GameUIType.Team:
            teamP.gameObject.SetActive(true);

            InitMemberUI();
            break;

        case GameUIType.Factory:
            factoryP.gameObject.SetActive(true);
            //TODO
            break;

        case GameUIType.Setting:
            settingP.gameObject.SetActive(true);
            //TODO
            break;

        default:
            break;
        }
    }
Пример #2
0
        public void Change(GameUIType type)
        {
            var oldUI   = this.GetUI(this.currentUIType);
            var oldType = this.currentUIType;
            var newUI   = this.GetUI(type);

            oldUI.SetActive(false);
            newUI.SetActive(true);
            this.currentUIType = type;
            UniRxEvent.GlobalBroker.Publish(ChangedUI.Get(type, newUI, oldType, oldUI));
        }
Пример #3
0
        public GameObject GetUI(GameUIType type)
        {
            switch (type)
            {
            case GameUIType.Expedition:
                return(this.expeditionUI);

            case GameUIType.Craft:
                return(this.craftUI);

            default:
                Assert.IsTrue(false, string.Format("未対応の値です {0}", type));
                return(null);
            }
        }
Пример #4
0
    /// <summary> 关闭特定类别的UI </summary>
    private void CloseUI(GameUIType gameUIType)
    {
        switch (gameUIType)
        {
        case GameUIType.Fight:
            fightP.gameObject.SetActive(false);
            break;

        case GameUIType.Team:
            teamP.gameObject.SetActive(false);
            break;

        case GameUIType.Factory:
            factoryP.gameObject.SetActive(false);
            break;

        case GameUIType.Setting:
            settingP.gameObject.SetActive(false);
            break;

        default:
            break;
        }
    }
Пример #5
0
 /// <summary> 点击了按钮 切换UI类别 </summary>
 private void OnClick_UIType(GameUIType gameUIType)
 {
     CloseUI(uiType);
     uiType = gameUIType;
     ShowUI(uiType);
 }