Exemple #1
0
	public void CreateSceneFromInfo(MapInfo mapInfo)
	{
		if (SceneObjects.CheckListSize () > 0) {
			SceneObjects.ClearScene (); 
		}

		uiCanvas.GetComponent<CanvasController> ().SetActiveForButtons (mapInfo);

		int seedX = mapInfo.seedX; 
		int seedY = mapInfo.seedY; 
		int seedZ = mapInfo.seedZ; 

		gridWidth  = 40;
		gridHeight = 40;
		warningList = new List<Vector2> ();
		grid = new Grid (gridWidth,gridHeight, 0.5f, 0.5f);
		layout = new Layout (grid, mapInfo);

		//ForestSetup.CreateForestMeshFromMap (layout, grid, seedX, seedY, seedZ);

		//CreateMeshFromMap ();
		if (mapInfo.type == 2) {
			DungeonSetup.CreateMineMeshFromMap(layout, grid, mapInfo);
		}else{
			ForestSetup.CreateForestMeshFromMap (layout, grid, seedX, seedY, seedZ);
		}

		grid.ExpandGrid ();
		layout.ExpandLayout ();
		gridWidth = grid.width;
		gridHeight = grid.height;
		CreateBlocksOnEdges ();

		this.GetComponent<PartyController> ().SetCurrentPlayers (GetParty ());
		this.GetComponent<EnemyController> ().CreateEnemiesForTile();

	}