/// <summary> /// 清除指定场景 /// </summary> /// <param name="name">资源名称</param> /// <returns></returns> static bool DestroyLevel(string name) { EB.Debug.LogLoadLevel("<color=#ff0000>清除指定场景</color>_name:" + name); // SceneRootEntry entry = null; m_SceneRootDict.TryGetValue(name, out entry); if (entry != null) { if (name.Contains("MainLandView")) //|| name.Contains("CombatView")) { if (entry.m_SceneRoot != null) { entry.m_SceneRoot.CustomSetActive(false); } return(true); } entry.DestroyLevel(); return(true); } else { EB.Debug.LogError("[SceneLoadManager]DestroyLevel: There is no definition of level [{0}]. ", name); } return(false); }
public void DestroyCurrentLevel() { if (m_RootEntry != null) { m_RootEntry.DestroyLevel(); } }
void HandleFinished(SceneRootEntry entry) { // may be destroyed, 如果进了if则会卡76% if (Equals(null)) { EB.Debug.LogError("[ThemeLoadManager].HandleFinished===> Equals(null)"); entry.DestroyLevel(); return; } if (entry.IsLoaded()) { entry.SetParent(gameObject); entry.ShowLevel(); } m_OnFinished?.Invoke(entry); }