Exemplo n.º 1
0
 private void UpdateSwitchScene()
 {
     // do unload scene here
     if (m_sceneToBeLoad != null)
     {
         Scene oldScene = Mgr <Scene> .Singleton;
         if (oldScene != null)
         {
             oldScene.Unload();
         }
         m_sceneToBeLoad.ActivateScene();
         m_sceneToBeLoad = null;
         if (_editor != null)
         {
             _editor.LoadSceneComplete();
         }
     }
 }
Exemplo n.º 2
0
        private void MountInGameProject()
        {
            CatProject project = CatProject.OpenProject(AppDomain.CurrentDomain.BaseDirectory + "project.xml", this);

            if (project == null)
            {
                System.Windows.Forms.MessageBox.Show("Level file project.xml does not exist.", "Vital Error",
                                                     System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                Exit();
            }
            Mgr <CatProject> .Singleton = project;
            Scene scene = Scene.LoadScene(project.GetSceneFileAddress(project.startupSceneName));

            if (scene == null)
            {
                System.Windows.Forms.MessageBox.Show("Fail to load startup scene: " + project.startupSceneName, "Vital Error",
                                                     System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                Exit();
            }
            scene.InitializeScene();
            scene.ActivateScene();
            Mgr <Scene> .Singleton = scene;
        }