I have a 5 * 6 grid. Before placing the tiles on the grid, how can I remove the four corners of the grid?
void CreateTiles ()
{
for (int i = 0; i < alphabetTilesList.Count; i++) {
float xOffset = 0.0f, yOffset = 0.0f;
for (int xTilesCreated = 0; xTilesCreated < gridWidth; xTilesCreated += 1) {
for (int yTilesCreated = 0; yTilesCreated < gridHeight; yTilesCreated += 1) {
Vector3 position = new Vector3 (transform.position.x + xOffset, transform.position.y + yOffset, transform.position.z);
//Randomly Choosing a tile from alphabetTilesList
int index = Random.Range (0, alphabetTilesList.Count);
chosenTile = alphabetTilesList[index]; //set the random tile as chosenTile
GameObject tile = Instantiate (chosenTile, position, Quaternion.identity) as GameObject;
alphabetTilesList.RemoveAt (index); //Remove chosen Tile
yOffset += transform.localScale.y + tilePadding;
}
xOffset += transform.localScale.x + tilePadding;
yOffset = 0.0f;
}
}
}