Пример #1
0
        IEnumerator Update(string url)
        {
            Downloader loader = new Downloader(url, _localPath, DateTime.UtcNow.ToFileTimeUtc().ToString());

            while (false == loader.isDone)
            {
                yield return(new WaitForEndOfFrame());
            }

            if (null != loader.error)
            {
                Log.E(loader.error);
                if (null != _onError)
                {
                    _onError.Invoke(loader.error);
                }
                yield break;
            }
            loader.Dispose();

            SettingVO vo = LoadLocalSetting();

            Runtime.Ins.setting   = vo;
            Runtime.Ins.netResDir = FileSystem.CombineDirs(true, vo.netResRoot, Runtime.Ins.platform);

            if (Runtime.Ins.setting.settingJump.ContainsKey(Application.version))
            {
                ILBridge.Ins.StartCoroutine(Update(Runtime.Ins.setting.settingJump[Application.version]));
            }
            else
            {
                _onLoaded();
            }
            yield break;
        }
Пример #2
0
        SettingVO LoadLocalSetting()
        {
            string    settingJsonStr = File.ReadAllText(_localPath);
            SettingVO vo             = LitJson.JsonMapper.ToObject <SettingVO>(settingJsonStr);

            return(vo);
        }