Esempio n. 1
0
        public static async ETTask DownloadBundle()
        {
            if (Define.IsAsync)
            {
                try
                {
                    Game.EventSystem.Run(EventIdType.LoadingBegin);
                    Game.Scene.AddComponent <BundleDownloaderComponent>();
                    await GameUpdateMgr.Ins.UpdateGame();

                    Game.Scene.GetComponent <ResourcesComponent>().LoadOneBundle("StreamingAssets");
                    ResourcesComponent.SetAssetBundleManifestObject((AssetBundleManifest)Game.Scene.GetComponent <ResourcesComponent>().BundleNameGetAsset("StreamingAssets", "AssetBundleManifest"));
                    Game.EventSystem.Run(EventIdType.LoadingFinish);
                }
                catch (Exception e)
                {
                    UILoadingComponent.Ins.ShowHint("网络无法连接,请检查您的网络", (bol) =>
                    {
                        Application.Quit();
                        Log.Error("退出了游戏");
                    }, PopHintOptionType.Single, "确 定");

                    Log.Error(e);
                }
            }
            else
            {
#if UNITY_EDITOR
                ResourcesComponent.RecordAssbundlsName(AssetDatabase.GetAllAssetBundleNames());
#endif
            }
        }