private void OnCodeLoaded() { _downLoadCombin = null; HotScriptManager.Instance.Init(); //注 初始化顺序不能乱 NetManager.Instance.Init(); //注 初始化网络层 if (IsAddAttachDebugTime) { SetTipsMessage("等待附加ILruntime Debug ..."); countDown = 15; InvokeRepeating("DelayRepeatingTimeStart", 0, 1); return; } #if UNITY_EDITOR #elif UNITY_ANDROID || UNITY_IPHONE IsDownLoad = true; #endif if (!IsDownLoad) { OnPlatformLobbyResLoaded(); return; } _msgText.text = "更新资源......Lobby"; bool b = DownLoadManager.Instance.IsNewestVersion("PlatformLobby"); if (!b) { _downLoadCombin = DownLoadManager.Instance.DownLoadGame("PlatformLobby", OnPlatformLobbyResLoaded); } else { OnPlatformLobbyResLoaded(); } }
public void OnPlatformLobbyResLoaded() { HotScriptManager.Instance.InitHotScript();//注 初始化顺序不能乱 _downLoadCombin = null; SetTipsMessage(); Utils.Log("开始显示登录界面"); ShowLoginView(); }
/// <summary> /// 开始下载对应资源 /// </summary> /// <param name="gameName">文件夹</param> /// <param name="handler"></param> public DownLoadCombin DownLoadGame(string gameName, DownLoadCompletedHandler handler = null) { if (_startLoadGameDict.ContainsKey(gameName) && _startLoadGameDict[gameName].IsLoading) { return(_startLoadGameDict[gameName]); } DownLoadCombin dlc = DownLoadCombin.CreatToStartDownLoad(_gameResfileInfoDict[gameName], handler); _startLoadGameDict[gameName] = dlc; return(dlc); }
public static DownLoadCombin CreatToStartDownLoad(GameResFileInfo info, DownLoadCompletedHandler handler = null) { GameObject obj = new GameObject("downLoad_"); obj.name = "downLoad_" + obj.GetInstanceID(); obj.hideFlags = HideFlags.HideInHierarchy; GameObject.DontDestroyOnLoad(obj); DownLoadCombin dlm = obj.AddComponent <DownLoadCombin>(); dlm.completedHandler = handler; dlm.StartDownLoad(info); return(dlm); }
IEnumerator StartInit() { _msgText.text = "检测资源版本"; #if UNITY_EDITOR #elif UNITY_ANDROID || UNITY_IPHONE IsDownLoad = true; #endif DownLoadManager.Instance.Initialize(); if (!IsDownLoad) { OnCodeLoaded(); yield break; } while (!DownLoadManager.IsInited) { yield return(null); } if (IsOpenAssetsListApplicationVersion) { if (AppVersionCompare(Application.version, URLFactory.NewAppVersion)) { string msg = "游戏版本过低,请下载最新安装包进行游戏"; Utils.MessagePopup(msg, UpdateIphonePackage, 1, true, "前往"); yield break; } } _msgText.text = "更新资源......ode"; bool b = DownLoadManager.Instance.IsNewestVersion("PlatformLobbyCode"); if (!b) { _downLoadCombin = DownLoadManager.Instance.DownLoadGame("PlatformLobbyCode", OnCodeLoaded); } else { OnCodeLoaded(); } }