Example #1
0
 public void NewScene()
 {
     _scene.Unload();
     gizmoComponent.Selection.Clear();
     _scene = new EDScene("Root", gizmoComponent);
     _scene.Initialize();
     _scene.RenderSettings.Skybox.Generate();
 }
Example #2
0
        protected override void Initialize()
        {
            base.Initialize();

            _gameTime       = new GameTime(TimeSpan.Zero, TimeSpan.Zero);
            _gameComponents = new List <GameComponent>();

            _services = new GameServiceContainer();
            _services.AddService <IGraphicsDeviceService>(new GraphicsDeviceService(graphicsDevice));

            _content = new ContentManager(this);
            _content.RootDirectory = "Content";

            _projectContent = new ContentManager(this);
            _projectContent.RootDirectory = EDRegistry.ContentTempPath;

            AssetImporter.CreateFolderStructure("Temp");

            Application.Content        = _content;
            Application.GraphicsDevice = GraphicsDevice;

            _gameComponents.Add(EDRegistry.Mouse);
            _gameComponents.Add(EDRegistry.Keys);
            _gameComponents.Add(new Time());

            _renderer = new ForwardRenderer();
            _renderer.Initialize(_content);

            foreach (var component in _gameComponents)
            {
                component.Initialize();
            }

            gizmoComponent            = new GizmoComponent(GraphicsDevice);
            gizmoComponent.ActiveMode = GizmoMode.Translate;

            _scene = new EDScene("Root", gizmoComponent);
            _scene.Initialize();
            _scene.RenderSettings.Skybox.Generate();

            MouseDown += C3DEGameHost_MouseDown;
            MouseUp   += C3DEGameHost_MouseUp;

            if (EngineReady != null)
            {
                EngineReady();
            }
        }
 private void OnLoaded(object sender, System.Windows.RoutedEventArgs e)
 {
     sceneTreeView.SelectedItemChanged += OnSelectedItemChanged;
     UpdateList();
     scene = Scene.current as EDScene;
 }