private void LoadScene(String filename) { if (String.IsNullOrEmpty(filename)) { throw new Exception("LoadScene() was called with an empty filename path"); } LoadingForm.ShowForm(); Application.DoEvents(); IceCream.Serialization.SceneSerializer.StatusUpdate += new IceCream.Serialization.StatusUpdateHandler(SceneSerializer_StatusUpdate); LoadSceneDelegate del = new LoadSceneDelegate(LoadSceneData); del.BeginInvoke(filename, new AsyncCallback(LoadSceneCallBack), null); }
private void LoadProject(String filename) { //If there is a currently loaded project and scene, unload the scene and clear up first. if (_currentProject != null && SceneManager.ActiveScene != null) { SceneManager.UnLoadScene(SceneManager.ActiveScene); SceneManager.ActiveScene = null; SceneManager.GlobalDataHolder.ContentManager.Unload(); SceneManager.GlobalDataHolder = new GlobalDataHolder(); SceneManager.Scenes.Clear(); _contentBuilder.Clear(); toolStripSplitButtonAddSceneComponent.DropDownItems.Clear(); menuAddSceneItemComponent.DropDownItems.Clear(); } LoadingForm.ShowForm(); LoadingForm.ChangeHeader("Loading Project Data"); Application.DoEvents(); IceCream.Serialization.SceneSerializer.StatusUpdate += new IceCream.Serialization.StatusUpdateHandler(SceneSerializer_StatusUpdate); LoadSceneDelegate del = new LoadSceneDelegate(LoadProjectData); del.BeginInvoke(filename, new AsyncCallback(LoadProjectCallBack), null); }