OnLevelStarted() 공개 메소드

The handler to be called on level start.
public OnLevelStarted ( ) : void
리턴 void
예제 #1
0
		/// <summary>
		/// Go to a new level.
		/// </summary>
		/// <param name="name">Level name.</param>
		public static void GotoLevel(string name)
		{
			if (!LevelExists(name))
				throw new ArgumentException("Level with such name does not exist!");

			if(CurrentScene != null)
				CurrentScene.OnLevelEnded();

			CurrentScene = Scenes[name];
			CurrentScene.OnLevelStarted();
		}
예제 #2
0
		/// <summary>
		/// Create a new level and add it to the storyboard.
		/// </summary>
		/// <param name="name">Desired level name (must be unique across the game).</param>
		/// <param name="level">Level.</param>
		/// <returns></returns>
		public static void AddLevel(string name, GameScene level)
		{
			if(LevelExists(name))
				throw new ArgumentException("Level with such name already exists!");

			Scenes.Add(name, level);

			if (CurrentScene == null)
			{
				CurrentScene = level;
				level.OnLevelStarted();
			}
		}