Пример #1
0
        public void SwitchScene(Type type)
        {
            if (!type.IsSubclassOf(typeof(Scene)))
            {
                return;
            }

            var scene = (Scene)Activator.CreateInstance(type);

            CurrentScene?.UnloadContent();
            CurrentScene = (Scene)scene;
            CurrentScene.SetSceneManager(this);
            CurrentScene?.Initialize();
            CurrentScene?.LoadContent();
        }
Пример #2
0
 public bool LoadContent(ContentManager contentManager)
 {
     return(CurrentScene.LoadContent(contentManager));
 }