I've got this little chunk here, but I was wondering if I could use GetTile()
using a specific variable within the array.
EDIT: my entire script is:
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;
public class walltilemap : MonoBehaviour
{
public TileBase Ground_tiles_3;
public Vector2Int size;
void Start(){
Vector3Int[] positions = new Vector3Int[size.x * size.y];
TileBase[] tileArray = new TileBase[positions.Length];
for (int index = 0; index < positions.Length; index++){
positions[index] = new Vector3Int(index % size.x, index / size.y, 0);
bool iswalltile() {
if (Tilemap.GetTile(positions[index])){
}
return true;
}
tileArray[index] = iswalltile() == true ? Ground_tiles_3 : null;
}
Tilemap WallTileMap = GetComponent<Tilemap>();
WallTileMap.SetTiles(positions, tileArray);
}
}