Ejemplo n.º 1
0
        private void SaveAndReloadScene()
        {
            // serialize scene
            var str = SceneJsonConverter.SerializeScene(_scene);

            Console.WriteLine(str);

            var path = _projectdir + "\\ProjectData\\Scenes\\MainScene.json";

            File.WriteAllText(path, str);

            _isSimulating = false;
            ReloadScene();
        }
Ejemplo n.º 2
0
        private void LoadSceneElements()
        {
            var path     = _projectdir + "\\ProjectData\\Scenes\\MainScene.json";
            var sceneStr = File.ReadAllText(path);

            //Console.WriteLine("Text read: " + sceneStr);


            _scene = SceneJsonConverter.ParseStr(sceneStr);
            Console.WriteLine("Loaded scene: " + _scene);

            foreach (var sceneObject in _scene.Objects)
            {
                listView1.Items.Add(sceneObject.Name);
            }
        }