Ejemplo n.º 1
0
 public void RegisterScene(Scene scene)
 {
     if (!NamedScenes.ContainsKey(scene.GetType()))
     {
         NamedScenes.Add(scene.GetType(), scene);
         Scenes.Add(scene);
     }
 }
Ejemplo n.º 2
0
 public void SetScene <T>() where T : Scene
 {
     if (typeof(T) == typeof(GameScene))
     {
         SoundManager.PlayMusic("LevelMusic");
     }
     else
     {
         SoundManager.PlayMusic("TitleScreen_Loop");
     }
     if (NamedScenes.ContainsKey(typeof(T)))
     {
         CurrentScene?.Stop();
         CurrentScene = NamedScenes[typeof(T)];
         CurrentScene.Start();
     }
 }