예제 #1
0
        public static void Init( List<VPLevel> levels )
        {
            _levels = levels;
             CurrentLevel = null;

             if ( levels.Any() )
             {
            SetLevel( levels[0].GetType() );
             }
        }
예제 #2
0
        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;
             }
        }