Example #1
0
 public void DoSwitchScene(string _scenefile)
 {
     m_sceneToBeLoad = Scene.LoadScene(_scenefile);
     if (m_sceneToBeLoad != null)
     {
         m_sceneToBeLoad.InitializeScene();
     }
 }
Example #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;
        }