private int paintOceanTiles(List <GameTile> tiles, TileTypeSettings settings) { int numOceanTiles = 0; for (int i = 0; i < tiles.Count; i++) { if (settings.IsOceanTileBySettings(tiles [i])) { hexSettings.assignTileTypeToHex(tiles[i], TileType.Ocean); tiles[i].transform.FindChild("Dice Value").gameObject.SetActive(false); tiles [i].atIslandLayer = true; numOceanTiles++; } } return(numOceanTiles); }
private int paintOceanTiles(List <GameTile> tiles) { int numOceanTiles = 0; for (int i = 0; i < tiles.Count; i++) { if (boardSettings.IsOceanTileBySettings(tiles [i])) { boardSettings.assignTileTypeToHex(tiles[i], TileType.Ocean); //MonoBehaviour.Destroy (tiles[i].transform.FindChild ("Dice Value").gameObject); tiles[i].transform.FindChild("Dice Value").gameObject.SetActive(false); numOceanTiles++; } } return(numOceanTiles); }
private void paintTileWithType(GameTile tile) { if (hexSettings.IsOceanTileBySettings(tile)) { MonoBehaviour.Destroy(tile.transform.FindChild("Dice Value").gameObject); hexSettings.assignTileTypeToHex(tile, TileType.Ocean); } else { int maxMapDimension = Mathf.Max(mapWidth, mapHeight); int difference = maxMapDimension - hexSettings.oceanLayers; bool canBeLake = (Mathf.Abs(tile.index.x) + Mathf.Abs(tile.index.y) + Mathf.Abs(tile.index.z)) < (difference * 2); Debug.Log("Tile index = [" + Mathf.Abs(tile.index.x) + ", " + Mathf.Abs(tile.index.y) + ", " + Mathf.Abs(tile.index.z) + "], difference * 2 = " + (difference * 2) + "canBeLake = " + canBeLake); TileType randomType = hexSettings.getRandomTileType(canBeLake); if (randomType == TileType.Desert) { MonoBehaviour.Destroy(tile.transform.FindChild("Dice Value").gameObject); } hexSettings.assignTileTypeToHex(tile, randomType); } }