public static void Init( List<VPLevel> levels ) { _levels = levels; CurrentLevel = null; if ( levels.Any() ) { SetLevel( levels[0].GetType() ); } }
public static bool SetLevel( Type levelType ) { try { var level = _levels.Single( x => x.GetType() == levelType ); if ( CurrentLevel != null ) { CurrentLevel.UnloadContent(); } CurrentLevel = level; CurrentLevel.LoadContent(); return true; } catch ( Exception ex ) { return false; } }