示例#1
0
    private void LoadFile(string path)
    {
        string content = FileUtils.ReadStringFile(path);
        RunnerTrunkElementConfig config = XmlConfigBase.DeSerialize <RunnerTrunkElementConfig>(content);

        m_TmpConfigList.Add(config);
    }
示例#2
0
    public RunnerTrunkTableConfig GetTrunkConfigTable()
    {
        TrunkConfigTable config = TryGetConfig <TrunkConfigTable>(ConfigPath_LimitFuncSceneConfig);

        if (null == config || string.IsNullOrEmpty(config.TrunkConfigXml))
        {
            return(null);
        }
        RunnerTrunkTableConfig res = XmlConfigBase.DeSerialize <RunnerTrunkTableConfig>(config.TrunkConfigXml);

        return(res);
    }
示例#3
0
 private void LoadSystemConfig()
 {
     try
     {
         var content = File.ReadAllText(SystemConst.settingConfigPath);
         SystemConst.Config = XmlConfigBase.DeSerialize <PathConfig>(content);
     }
     catch (Exception e)
     {
         SystemConst.Config = new PathConfig();
     }
 }
        private void OnLoadPackedConfigInfoDone(string content, Exception e)
        {
            var tmpLoader = m_Root.GetComponent <PackageResourceLoader>();

            if (null != tmpLoader)
            {
                GameObject.Destroy(tmpLoader);
            }

            if (null != e)
            {
                Debug.LogException(e);

                OnComplate();
                return;
            }
            if (string.IsNullOrEmpty(content))
            {
                Debug.LogError("cant' load streaming asset info config");

                OnComplate();
                return;
            }

            try
            {
                var config = XmlConfigBase.DeSerialize <PackageResourceConfig>(content);
                if (null == config)
                {
                    Debug.LogError("cant' load streaming asset info config");
                    OnComplate();
                    return;
                }

                DoUnpack(config);
            }
            catch (Exception exception)
            {
                Debug.LogException(exception);
                OnComplate();
            }
        }
示例#5
0
    private void Test()
    {
        if (Application.platform == RuntimePlatform.Android && (Input.GetKeyDown(KeyCode.Escape)))
        {
            TipManager.Instance.Alert("", "你确定要退出游戏吗?", "确定", "取消", (res) =>
            {
                if (res)
                {
                    Application.Quit();
                }
            });
        }
        if (Input.GetKeyDown(KeyCode.F1))
        {
            WindowBase window = WindowManager.Instance.GetWindow(WindowID.MissionDebugAttach);
            if (null == window)
            {
                WindowManager.Instance.OpenWindow(WindowID.MissionDebugAttach);
            }
            else
            {
                if (window.IsOpen())
                {
                    window.Close();
                }
                else
                {
                    WindowManager.Instance.OpenWindow(WindowID.MissionDebugAttach);
                }
            }
        }
        if (Input.GetKeyDown(KeyCode.C) || Input.touchCount == 3)
        {
            string filepath = ResourceManager.Instance.GetStreamAssetPath() + "/config.xml";

            ResourceManager.Instance.LoadStreamingAssetsData(filepath, (www) =>
            {
                SysConfig tmp = XmlConfigBase.DeSerialize <SysConfig>(www.text);
                Debuger.LogError("system config decode result : " + tmp == null);
                if (tmp != null)
                {
                    Debuger.LogError(tmp.ServerConfigPath);
                    Debuger.LogError(tmp.ClientConfigPath);
                    Debuger.LogError(tmp.ExcelPath);
                    Debuger.LogError(tmp.ConfigCenterUrl);
                    Debuger.LogError(tmp.UploadUrl);

                    Debuger.LogError("begin encode resoult");
                    string res = XmlConfigBase.Serialize(tmp);
                    Debuger.LogError("encode result:" + res);
                    FileUtils.WriteStringFile(Application.persistentDataPath + "/tesw.xml", res);

                    tmp = XmlConfigBase.DeSerialize <SysConfig>(res);
                    Debuger.LogError("xxx system config decode result : " + tmp == null);
                    if (tmp != null)
                    {
                        Debuger.LogError(tmp.ServerConfigPath);
                        Debuger.LogError(tmp.ClientConfigPath);
                        Debuger.LogError(tmp.ExcelPath);
                        Debuger.LogError(tmp.ConfigCenterUrl);
                        Debuger.LogError(tmp.UploadUrl);

                        Debuger.LogError("begin encode resoult");
                        res = XmlConfigBase.Serialize(tmp);
                        Debuger.LogError("encode result:" + res);
                        FileUtils.WriteStringFile(Application.persistentDataPath + "/tesw1.xml", res);
                    }
                }
            });
        }
    }