public void LoadScene(int id, ContentLoader contentLoader) { var scene = sceneList.Where(i => i.Id == id).FirstOrDefault(); if (scene == null) { throw new Exception("Scene cannot be found"); } currentScene = scene; scene.Load(contentLoader); }
private void Init() { //create the scene you wanna build worldScene = new WorldScene(); battleScene = new BattleScene(); startScene = new StartScene(); indoorScene = new IndoorScene(); sceneList = new List <SceneBase>() { startScene, worldScene, indoorScene, battleScene }; }
public void LoadScene(string name, ContentLoader contentLoader) { if (currentScene != null) { currentScene.UnLoad(); } var scene = sceneList.Where(i => i.Name == name).FirstOrDefault(); if (scene == null) { throw new Exception("Scene cannot be found"); } currentScene = scene; currentScene.Load(contentLoader); }