Beispiel #1
0
        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);
        }
Beispiel #2
0
 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
     };
 }
Beispiel #3
0
        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);
        }