public void AddScene(SceneViewModel s)
        {
            //build scene according to model
            var scene = new Scene();
            scene.SceneName = s.SceneName;
            scene.PhysicalWorld = new FarseerPhysicalWorld(Vector2.Zero);
            var sceneVM = new SceneTabViewModel(scene);
            Tabs.Add(sceneVM);

            _game.GameWorld.AddScene(scene);
            _game.GameWorld.SetActiveScene(scene);

            if (OnSceneAdded != null)
                OnSceneAdded(sceneVM);

            ScenesControl.SelectedItem = sceneVM;
        }
Esempio n. 2
0
 private void gameObjectsControl1_OnSceneDoubleClicked(SceneViewModel obj)
 {
     SceneViewControl.AddScene(obj);
 }
        private void AddScenesAndFolders(TreeViewItemViewModel parent, DirectoryInfo currentDirectory)
        {
            var fis = currentDirectory.GetFilesByExtension(FilesExtensions.SceneSavedModel);
            foreach (var fi in fis)
            {
                var svm = new SceneViewModel(parent, _nodeAddCB, fi.Name, fi.FullName);
                parent.Children.Add(svm);
            }

            var childDirectories = currentDirectory.GetDirectories();
            foreach (var di in childDirectories)
            {
                var folder = new FolderViewModel(parent, _nodeAddCB, di.Name, di.FullName, "Scenes");
                parent.Children.Add(folder);
                AddScenesAndFolders(folder, di);
            }
        }