Exemplo n.º 1
0
        public void GetAllConfigBytes(Dictionary <string, byte[]> output)
        {
            var types = Game.EventSystem.GetTypes(typeof(ConfigAttribute));

            foreach (var kv in types)
            {
                output[kv.Name] = XAssetLoader.LoadAsset <TextAsset>(XAssetPathUtilities.GetNormalConfigPath(kv.Name)).bytes;
            }
        }
Exemplo n.º 2
0
        private async ETVoid InternalAwake()
        {
            try
            {
                // 设置全局模式
                GlobalDefine.ILRuntimeMode = this.ILRuntimeMode;
                GlobalDefine.DevelopMode   = this.DevelopMode;
                GlobalDefine.SetLoginAddress(LoginAddress);

                // 限制帧率,尽量避免手机发烫
                QualitySettings.vSyncCount  = 0;
                Application.targetFrameRate = 60;

                SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);

                DontDestroyOnLoad(gameObject);

                // 初始化FGUI系统
                FUIEntry.Init();

                Updater updater = this.GetComponent <Updater>();
                m_XAssetUpdater = new XAssetUpdater(updater);

                FUI_CheckForResUpdateComponent.Init(m_XAssetUpdater.Updater);

                await m_XAssetUpdater.StartUpdate();

                byte[] dllByte = XAssetLoader.LoadAsset <TextAsset>(XAssetPathUtilities.GetHotfixDllPath("Hotfix"))
                                 .bytes;
                byte[] pdbByte = XAssetLoader.LoadAsset <TextAsset>(XAssetPathUtilities.GetHotfixPdbPath("Hotfix"))
                                 .bytes;

                HotfixHelper.GoToHotfix(dllByte, pdbByte);

                GloabLifeCycle.StartAction?.Invoke();
            }
            catch (Exception e)
            {
                Log.Error(e);
                throw;
            }
        }
Exemplo n.º 3
0
 public byte[] GetOneConfigBytes(string configName)
 {
     return(XAssetLoader.LoadAsset <TextAsset>(XAssetPathUtilities.GetNormalConfigPath(configName)).bytes);;
 }