Esempio n. 1
0
		public void LoadLevel (string levelIndex)
		{
			var loader = new XMLLoader();
			var Level = loader.Load(levelIndex);

			foreach (var obj in Level)
			{
				if (obj.Type == ObjectTypes.BigAsteroid || obj.Type == ObjectTypes.SmallAsteroid)
				{
					GameObject asteroid =  (GameObject)Instantiate (ReturnObject(obj.Type), obj.Position, obj.Rotation);
					var asteroidScript = asteroid.GetComponent<Asteroid>();
					asteroidScript.AsteroidType = obj.AType;
					asteroidScript.RotateClockwise = obj.AClockWise;
					asteroidScript.Speed = obj.ASpeed;
					asteroidScript.PathLength = obj.ALength;
				}
				else
				{
					Instantiate (ReturnObject(obj.Type), obj.Position, obj.Rotation);
				}
			}

			_loo.Sort();

			_gameManager.SetState(GameManager.GameState.WaitingForInput);
		}
Esempio n. 2
0
		public void ButtonDown (string levelIndex) 
		{
			var loader = new XMLLoader();
			loader.Load(levelIndex);
		}