示例#1
0
 public SADirector(Game game, GraphicsDeviceManager graphics, SpriteBatch spriteBatch)
 {
     SADirector.game        = game;
     SADirector.content     = game.Content;
     SADirector.graphics    = graphics;
     SADirector.spriteBatch = spriteBatch;
     screenDictionary       = new Dictionary <ScreenType, SAScreen>();
     //注册 Global
     SAGlobal.Setup(game, spriteBatch, graphics);
     //注册MusicManager
     SAMusicManager.Setup();
     //ATTENTION 加载第一个页面
     LoadFirstScreen();
 }
示例#2
0
 /// <summary>
 /// 只有在加载页面动画完成后才释放资源
 /// </summary>
 public static void ReleaseScreen()
 {
     if (previousScreen != null)
     {
         //重置资源
         //特别注意的是,释放Input资源应该在加载新页面之前!
         SAGlobal.CleanTemporalContent();
         if (previousScreen.Releasable)
         {
             screenDictionary.Remove(previousScreenType);
         }
         //重置指针
         previousScreen = null;
     }
 }
示例#3
0
 protected void CreateContentManager()
 {
     ScreenContent = SAGlobal.CreateContentManager();
 }