static void BuildLevel() {
		int num = 0;
		for (int y = 0; y < inputTexture.height; y++) {
			for (int x = 0; x < inputTexture.width; x++) {
				num = inputTexture.width * y + x;
				//Build walls
				if (pix [num] == Color.blue) {
					tempBlock = inputTexture.GetPixels(x - 1, y - 1, 3, 3);
					wallType = DetermineType();
					wallRot = DetermineRotation();
					
					PlaceWall(x, y, wallType, wallRot);
					
				} else if (pix [num] == Color.green) {
					tempBlock = inputTexture.GetPixels(x - 1, y - 1, 3, 3);
					PlaceLight(x, y);
				}
			}
		}
		/*
		for (int i = 0; i < inputTexture.height; i++) {
			StartCoroutine(TestPixels(i));
		}
		*/
		//Place floor
		PlaceFloor();
	}
	/*
	IEnumerator TestPixels(int y) {
		for (int x = 0; x < inputTexture.width; x ++) {
			int num = inputTexture.height * y + x;
			
			//Build walls
			if (IsColor(pix [num], Color.blue)) {
				wallType = DetermineType(x, y);
				wallRot = DetermineRotation(x, y);
				
				PlaceWall(x, y, wallType, wallRot);

			} else if (IsColor(pix [num], Color.yellow)) {
				PlaceLight(x, y);
			}
		}
		return;
	}
	*/
	static void PlaceWall(int xPos, int zPos, WallTypes type, int rot) {
		Quaternion rotation = Quaternion.Euler(new Vector3 (0, 90 * rot, 0));
		string prefab = "Empty";
		if (type == WallTypes.WALL) {
			prefab = "Wall_" + Random.Range(1, 4);
		} else if (type == WallTypes.CORNER_INNER) {
			prefab = "Wall_CornerInner";
		} else if (type == WallTypes.CORNER_OUTER) {
			prefab = "Wall_CornerOuter";
		} else {
			prefab = "ErrorCube";
		}

		GameObject wall = (GameObject)PrefabUtility.InstantiatePrefab(Resources.Load("Prefabs/Environment/" + prefab) as GameObject);
		Undo.RegisterCreatedObjectUndo(wall, "Undo Level insert");
		if (GameObject.Find("GeneratedLevel") != null) {
			wall.transform.parent = GameObject.Find("GeneratedLevel").transform;
		}
		wall.transform.position = new Vector3 (xPos, 0, zPos);
		wall.transform.rotation = rotation;
	}