public static IceScene AddBlankScene() { IceScene _newScene = new IceScene(); Camera _camera = new Camera(); _newScene.ActiveCameras.Add(_camera); Scenes.Add(_newScene); _newScene._content = new ContentManager(Game.Instance.Services); if (_activeScene == null) { _activeScene = _newScene; } return _newScene; }
/// <summary> /// Loads the given filename into a scene and returns it. /// </summary> /// <param name="filename">The filename of the scene</param> /// <param name="loadMaterials">Should load materials</param> /// <remarks>If false is passed to load materials they are not loaded from the content manager into the texture object. This is for the editor</remarks> public static IceScene LoadScene(string filename, bool loadMaterials) { if (!filename.EndsWith(".icescene")) { filename += ".icescene"; } string _filename = Path.GetFullPath(filename); if (!File.Exists(_filename)) { throw new FileNotFoundException("File Not Found: " + filename); } IceScene scene = Serialization.SceneSerializer.DeSerializeScene(filename, @"Content\"); scene.WillRenderNotActive = false; Scenes.Add(scene); if (_activeScene == null) { _activeScene = scene; } if (loadMaterials == true) { InitializeScene(scene); } scene.Enabled = true; scene.WillRenderNotActive = true; return scene; }