Пример #1
0
    public void ShowChooseServerUIFormCreateChr(bool isConnectSuccess = true)
    {
        ShowChooseServerUI(isConnectSuccess);
        m_onChooseServerUIBackBtnUp = () =>
        {
            if (!m_isConnectSuccess)
            {
                MogoMessageBox.Info("Please select a server.");
                return;
            }
            MogoWorld.LoadCharacterScene();
        };

        m_onChooseServerGridUp = (index) =>
        {
            if (index != 0 && m_isConnectSuccess && SystemConfig.SelectedServerIndex == index)
            {
                MogoWorld.LoadCharacterScene();
                return;
            }

            //Debug.Log(index);
            SystemConfig.SelectedServerIndex = index;
            var server = SystemConfig.GetServerInfoByIndex(index);
            Debug.Log("server.id: " + server.id);
            if (server != null)
            {
                SystemConfig.Instance.SelectedServer = server.id;
            }
            SystemConfig.SaveConfig();
            MogoWorld.Login();
            //EventDispatcher.TriggerEvent<int>(Events.UIAccountEvent.OnChangeServer, id);
        };
    }
Пример #2
0
 void OnCreateCharacterUIBackBtnUp()
 {
     MogoWorld.LoadCharacterScene();
 }