IEnumerator OnInitSceneSucced(SceneRootEntry sceneRoot) { LoadingLogic.AddCustomProgress(5); if (m_SceneRootEntry != null) { m_SceneRootEntry.ShowLevel(); } SetShadowQuality(sceneRoot); SetLayerMask(sceneRoot); sceneRoot.SetZonesTag(); sceneRoot.SetMainLight(); LoadingLogic.AddCustomProgress(15); PSPoolManager.Instance.LoadStandardMainlandFX(); yield return(new WaitUntil(() => { LoadingLogic.AddCustomProgress(1); return HudLoadManager.Completed; })); GlobalMenuManager.PopCaches(); MainLandLogic.GetInstance().FreshMapName(); MainLandLogic.GetInstance().OnSceneViewLoaded(); MainLandLogic.GetInstance().RobDartFight(); GameEngine.Instance.IsRunFromEnterGameBtn = false; LoadingLogic.AddCustomProgress(5); }
private IEnumerator WaitForReady() { DateTime t = DateTime.Now; EB.Debug.Log("WaitForReady=====>_{0}", t.ToString("yyyy-MM-dd hh:mm:ss fff")); while (!HudLoadManager.IsReady) { if (!HudLoadManager.IsLoadingConfig) { HudLoadManager.LoadConfigAsync(); } yield return(null); } LoadingLogic.AddCustomProgress(5); while (!SceneLoadManager.IsReady) { if (!SceneLoadManager.IsLoadingConfig) { SceneLoadManager.LoadConfigAsync(); } yield return(null); } LoadingLogic.AddCustomProgress(5); Mgr.SetGameState <GameStateLoadGame>(); t = DateTime.Now; EB.Debug.Log("<=====WaitForReady_{0}", t.ToString("yyyy-MM-dd hh:mm:ss fff")); }
private void ClearLightMap(List <LevelInfo> levelInfos) { LoadingLogic.AddCustomProgress(10, "ClearLightMap.Begin"); //将之前还在内存里的释放掉 List <enZoneType> clearList = new List <enZoneType>(); foreach (enZoneType zoneType in m_LightmapDataDic.Keys) { LevelInfo info = levelInfos.Find(p => p.v_ZoneType == zoneType); if (info == null) { clearList.Add(zoneType); } } for (int i = 0; i < clearList.Count; i++) { Resources.UnloadAsset(m_LightmapDataDic[clearList[i]].lightmapColor); m_LightmapDataDic.Remove(clearList[i]); } #region 登陆游戏在主城时,此处结束loading if (_isEnterMainView) { _isEnterMainView = false; UIStack.Instance.HideLoadingScreen(); } #endregion }
public override IEnumerator Start() { if (!UIStack.Instance.IsLoadingScreenUp) { UIStack.Instance.ShowLoadingScreen(null, true, false); } if (m_FlowControlObject == null) { LoadingLogic.AddCustomProgress(2); string path = "Assets/_GameAssets/Res/MISC/GameFlowControl/GameFlowControl"; EB.Assets.LoadAsync(path, typeof(GameObject), o => { if (o != null) { var go = GameObject.Instantiate(o) as GameObject; DownloadComplete(path, go); } }); while (m_FlowControlObject == null) { yield return(null); } } ChatController.instance.Init(); SparxHub.Instance.PushManager.OnScheduleLocalNotification += ScheduleLocalNotification; SparxHub.Instance.ChatManager.OnConnected += RegisterChatChannels; }
public override void OnEnter() { LegionLogic.GetInstance(); GuideManager.Instance.InitGuideState();//tOdo为什么删掉了 //预先加载主城场景 LoadingLogic.AddCustomProgress(2); SceneLoadManager.LoadOTALevelGroupAsync("MainLandView", SceneLoadBegin, SceneLoadFailed, SceneLoadLoading, SceneLoadFinished); }
public override void OnEnter() { LoadingLogic.AddCustomProgress(10); EventManager.instance.Raise(eSimpleEventID.Combat_Enter); //日志记录 GM.AssetManager.RecordLoadStart("CombatViewAction", "OnEnter"); base.OnEnter(); FusionAudio.PostGlobalMusicEvent("MUS_CombatView_Demo", true); }
protected override void SceneLoadFinished(SceneRootEntry sceneRoot) { LoadingLogic.AddCustomProgress(15); if (sceneRoot != null) { sceneRoot.ShowLevel(); } SceneLogic.SceneState = SceneLogic.eSceneState.SceneLoop; //UIStack.Instance.HideLoadingScreen(false); }
public override void OnEnter() { LoadingLogic.AddCustomProgress(10); base.OnEnter(); LTInstanceMapModel.Instance.LoadInstanceSpriteAtlas(); FusionAudio.PostGlobalMusicEvent("MUS_FuBen", true); if (LTMainHudManager.Instance.GetFromFirstBattleType()) { LTMainHudManager.Instance.SetsFromFirstBattleType(false); } Instance.LTInstanceConfigManager.LoadDatas(); }
protected override void SceneLoadFinished(SceneRootEntry sceneRoot) { if (sceneRoot != null && sceneRoot.IsLoaded()) { var themeLoadManager = sceneRoot.GetComponentInChildren <ThemeLoadManager>(); if (themeLoadManager != null) { LoadingLogic.AddCustomProgress(2); string levelName = SceneManager.MainLandName; themeLoadManager.LoadOTALevelAsync(levelName, levelName + ".unity.json", null, OnMainLandSceneLoadFailed, null, OnMainLandSceneLoaded); } } }
public override void OnEnter() { LoadingLogic.AddCustomProgress(10); hudLoaded = false; sceneLoaded = false; PartitionObject.FlushAllAndUnload(); base.OnEnter(); FusionAudio.PostGlobalMusicEvent("MUS_CampaignView_Demo", true); Hotfix_LT.Messenger.AddListener <EnemyController, eBattleType>("AttackEnemyImediatly", AttackEnemyImediatly); Hotfix_LT.Messenger.Raise("LTSpeedSnatchEvent.IdleFollow"); MainlandViewAction(); LTWelfareModel.Instance.SetMaxCampaignLevel();//更新通关的最大章节 }
void _PostLogin(Hashtable reqData) { LogWithTime("_PostLogin=====>"); LoadingLogic.AddCustomProgress(5); _api.LoginData(reqData, delegate(string err, Hashtable data) { LogWithTime("_api.LoginData=====>1"); LoadingLogic.AddCustomProgress(5); if (!string.IsNullOrEmpty(err)) { _LoginFailed(err); return; } LogWithTime("_api.LoginData=====>2"); Hub.Instance.DataStore.LoginDataStore.LoginData = data ?? Hub.Instance.DataStore.LoginDataStore.LoginData; LogWithTime("_api.LoginData=====>3"); var user = Dot.Object("user", data, null); if (user == null) { return; } LogWithTime("_api.LoginData=====>4"); LocalUser = Hub.Instance.UserManager.GetUser(user); _account.Add(_user); BugReport.AddData("uid", _user.Id.ToString()); Hashtable configs = EB.Dot.Object("configs", Hub.Instance.DataStore.LoginDataStore.LoginData, null); Hub.Instance.DataStore.LoginDataStore.LoginData.Remove("configs"); LogWithTime("_api.LoginData=====>5"); //从服务器拉取表,解析表 Hub.Instance.DataCacheManager.ProcessCaches(configs, error => { LogWithTime("<=====ProcessCaches"); if (!string.IsNullOrEmpty(error)) { _LoginFailed(error); return; } SetState(LoginState.LoggedIn); }, LoadingLogic.AddCustomProgress); }); }
protected override void SceneLoadFinished(SceneRootEntry sceneRoot) { EB.Debug.Log("MainLandViewAction.SceneLoadFinished=====>"); LoadingLogic.AddCustomProgress(15); if (sceneRoot != null && sceneRoot.IsLoaded()) { m_SceneRootEntry = sceneRoot; m_ThemeLoadManager = sceneRoot.GetComponentInChildren <ThemeLoadManager>(); sceneLoaded = true; LoadingLogic.AddCustomProgress(5); OnComplete(); if (m_ThemeLoadManager != null && !string.IsNullOrEmpty(MainLandLogic.GetInstance().CurrentEnvironmentName)) { string levelName = MainLandLogic.GetInstance().CurrentEnvironmentName; m_ThemeLoadManager.LoadOTALevelAsync(levelName, levelName + ".unity.json", null, OnInitSceneFailed, null, (SceneRootEntry entry) => { EB.Coroutines.Run(OnInitSceneSucced(entry)); }); } } LoadingLogic.AddCustomProgress(5); }
protected override void SceneLoadFinished(SceneRootEntry sceneRoot) { LoadingLogic.AddCustomProgress(15); UIStack.Instance.ResetNextStackDepth(); EB.Debug.Log("LoginProfile {0}", ((float)((System.DateTime.UtcNow.Ticks / 10000) % 100000) / 1000)); if (sceneRoot != null && sceneRoot.IsLoaded()) { m_SceneRootEntry = sceneRoot; m_ThemeLoadManager = sceneRoot.GetComponentInChildren <ThemeLoadManager>(); if (m_ThemeLoadManager != null) { LoadingLogic.AddCustomProgress(5); Combat_Scene_Name = GetCombatSceneName(); if (string.IsNullOrEmpty(Combat_Scene_Name)) { Combat_Scene_Name = DEFAULT_COMBAT_NAME; } m_ThemeLoadManager.LoadOTALevelAsync(Combat_Scene_Name, Combat_Scene_Name + ".unity.json", null, InitializeSceneFailed, null, InitializeScene); } InteractableObjectManager.Instance.SetParent(sceneRoot.m_SceneRoot.transform); } LoadingLogic.AddCustomProgress(10); }
IEnumerator InitializeSceneCoroutine(SceneRootEntry sceneRoot) { LoadingLogic.AddCustomProgress(10); EB.Debug.Log("LoginProfile {0}", ((float)((System.DateTime.UtcNow.Ticks / 10000) % 100000) / 1000)); if (m_SceneRootEntry != null) { m_SceneRootEntry.ShowLevel(); } while (!SceneLogic.MainHeroLoadComplete) { yield return(null); } LoadingLogic.AddCustomProgress(15); SetShadowQuality(sceneRoot); while (!HudLoadManager.Completed) { yield return(null); } UI3DLobby[] lobbys = GameObjectExtension.FindMonoILRObjectsOfType <UI3DLobby>("Hotfix_LT.UI.UI3DLobby", "Hotfix_LT.UI.UI3DVsLobby"); if (lobbys != null) { if (lobbys != null && lobbys.Length > 0) { for (var i = 0; i < lobbys.Length; i++) { var lobby = lobbys[i]; if (lobby != null) { EB.Debug.LogWarning("CombatViewAction: SceneLoadFinished Clean lobby = {0} ---> gameObject name: {1}", lobby, lobby.mDMono.name); GameObject.Destroy(lobby.mDMono.gameObject); } } } } LTMainHudManager.Instance.SetsFromFirstBattleType(false); if (SceneLogic.BattleType == eBattleType.FirstBattle) { LTMainHudManager.Instance.SetsFromFirstBattleType(true); UIStack.Instance.HideLoadingScreenImmediately(false, false); } else if (SceneLogic.isPVP()) { UIStack.Instance.WaitForOtherPlayer(); } else { //UIStack.Instance.HideLoadingScreenImmediately(false, false); } GM.AssetManager.RecordLoadEnd("CombatViewAction", "HideLoadingScreen"); LTCombatEventReceiver.Instance?.OnCombatViewLoaded(); MainLandLogic.GetInstance().OnCombatViewLoaded(); EB.Debug.Log("LoginProfile {0}", ((float)((System.DateTime.UtcNow.Ticks / 10000) % 100000) / 1000)); EB.Debug.Log("To initialize scene."); LoadingLogic.AddCustomProgress(5); }
private void Update_CheckMapDataUpdate(bool isInit = false) { if (WaitOptimize || !IsPlayerReady()) { return; } if (!_CheckMapDataUpdate_Dirty) { return; } if (_DelayUpdateNum > 0) { _DelayUpdateNum--; return; } int counterOnce = 0; if (PlayerObj.transform.localPosition.Equals(Vector3.zero) && LTInstanceMapModel.Instance.CurNode != null) { PlayerObj.transform.localPosition = new Vector3(PlayerObj.transform.localPosition.x, PlayerObj.transform.localPosition.y, -LTInstanceMapModel.Instance.CurNode.y * LTInstanceConfig.MAP_YZ + LTInstanceMapModel.Instance.CurNode.x * LTInstanceConfig.MAP_XZ); } //特殊初始化处理 if (setRowObjContainerPos && LTInstanceMapModel.Instance.CurNode != null) { var end = LTInstanceMapModel.Instance.CurNode; RowObjContainer.transform.localPosition = new Vector3(-(end.x + end.y) * LTInstanceConfig.MAP_X, (end.y - end.x) * LTInstanceConfig.MAP_Y, 0); setRowObjContainerPos = false; } if (setSpecialBoob) { SetSpecialBoob(); setSpecialBoob = false; } // while (_CheckMapDataUpdate_Queue.Count > 0) { var node = _CheckMapDataUpdate_Queue.Dequeue(); //_CheckMapDataUpdate_Queue.RemoveAt(0); LTInstanceRowCtrl row; if (rowCtrlDic.TryGetValue(node.y, out row)) { row.mDMono.gameObject.CustomSetActive(true); LTInstanceNodeTemp cell; if (row.itemObjDic.TryGetValue(node.x, out cell)) { if ((node.Type == LTInstanceNode.NodeType.WALL && !(cell is Instance.LTInstanceWallTemp)) || (node.Type == LTInstanceNode.NodeType.Floor && !(cell is Instance.LTInstanceFloorTemp)))//密道或格子类型发生反转的时候处理 { GameObject.Destroy(cell.mDMono.gameObject); row.itemObjDic.Remove(cell.Num); row.CreateNodeFromCache(node); } else { if (!isInit && node.Type == LTInstanceNode.NodeType.WALL) { continue; } cell.mDMono.gameObject.CustomSetActive(true); cell.UpdateData(node); continue; } } else { row.CreateNodeFromCache(node); } } else { CreateRowFromCache(node); } counterOnce++; if (LTInstanceMapModel.Instance.isFirstCreatFloor) { if (counterOnce % _CheckMapDataUpdate_MaxMore == 0) { LoadingLogic.AddCustomProgress(1); break; } } else if (counterOnce % _CheckMapDataUpdate_MaxOnce == 0) { _DelayUpdateNum = 1; break; } } if (_CheckMapDataUpdate_Queue.Count == 0) { if (LTInstanceMapModel.Instance.isFirstCreatFloor) { LTInstanceMapModel.Instance.isFirstCreatFloor = false; } OpenCloud(); _CheckMapDataUpdate_Dirty = false; } }
/// <summary> /// 加载相应的区域 /// </summary> /// <param name="zone">区域类型</param> private void LoadLevelZone(enZoneType zone) { LoadingLogic.AddCustomProgress(10, "LoadLevelZone.Begin"); for (var i = 0; i < _coroutines.Count; i++) { if (_coroutines[i] != null) { StopCoroutine(_coroutines[i]); } } _coroutines.Clear(); LevelInfo levelInfo = null; enZoneType tempType = (enZoneType)0; int lightmapIndex = 0; int count = 0; Dictionary <string, enZoneType> dict = new Dictionary <string, enZoneType>(); for (int i = 0; i <= m_LightmapStr.Count; i++) { tempType = (enZoneType)(1 << i); if ((zone & tempType) > 0) { levelInfo = m_StackObj.Find(p => p.v_ZoneType == tempType); if (levelInfo == null) { dict.Add(m_LightmapStr[tempType], tempType); var c1 = EB.Assets.LoadAsync(string.Format("_GameAssets/Res/Environment/s001a/MainLevelZone/Lightmap_{0}", m_LightmapStr[tempType]), typeof(Texture2D), (obj) => { var lightmapData = new LightmapData(); lightmapData.lightmapColor = obj as Texture2D; var key = dict[obj.name.Replace("Lightmap_", "")]; if (!m_LightmapDataDic.ContainsKey(key)) { m_LightmapDataDic.Add(key, lightmapData); } else { m_LightmapDataDic[key] = lightmapData; } var c2 = EB.Assets.LoadAsync(string.Format("_GameAssets/Res/Environment/s001a/MainLevelZone/{0}", m_LightmapStr[key]), typeof(GameObject), (o) => { var li = new LevelInfo(); li.v_LevelObj = Instantiate <GameObject>((GameObject)o); li.v_ZoneType = dict[o.name]; li.v_LightmapIndex = lightmapIndex; m_StackObj.Add(li); count++; lightmapIndex++; if (count > m_LightmapStr.Count) { ClearZone(zone); dict.Clear(); } }); _coroutines.Add(c2); }); _coroutines.Add(c1); } else { levelInfo.v_LightmapIndex = lightmapIndex; count++; lightmapIndex++; if (count > m_LightmapStr.Count) { ClearZone(zone); dict.Clear(); } } } else { count++; if (count > m_LightmapStr.Count) { ClearZone(zone); dict.Clear(); } } } }