Esempio n. 1
0
        protected IEnumerator LoadHotFixAysn()
        {
            Event.Trigger(Events.ON_HOT_FIXED_START);

            string[] filePath = Config.Get <string[]>("lua.hotfix");

            IResources resources = Application.Make <IResources>();

            foreach (string file in filePath)
            {
                FileInfo[] infos = (CEnv.AssetPath + "/" + file).RWalk();

                foreach (var info in infos)
                {
                    if (!info.Name.EndsWith(".manifest"))
                    {
                        yield return(resources.LoadAllAsyn <TextAsset>(file + "/" + info.Name, (textAssets) =>
                        {
                            Event.Trigger(Events.ON_HOT_FIXED_ACTION);
                            foreach (TextAsset text in textAssets)
                            {
                                LuaEnv.DoString(text.text);
                            }
                        }));
                    }
                }
            }
            Event.Trigger(Events.ON_HOT_FIXED_END);
            Event.Trigger(Events.ON_HOT_FIXED_COMPLETE);
        }