I’m trying to make tile generator. I have some tiles named like GrassTile01, GrassTile02, GrassTile03…
and in my c++ constructor I found some assets like this
ATileGenerator::ATileGenerator()
{
static ConstructorHelpers::FObjectFinder<UStaticMesh> GrassTile(TEXT("/Game/HighlandTileSet/Grass_01");
// ...
// in for loop, loop all tile x, y
if(GrassTile.Object != NULL)
TileFields[y].Tiles[x]->SetStaticMesh(GrassTile.Object);
}
but I think it’s not a good solution for my goal. because I have so many tiles.
I want to generate random tile map. so I want to find all my static meshes in some path like /Game/HighlandTile/ or /Game/DesertTile
is there some good solution for this? to make static FObjectFinder variables for each static mesh is only way to find assets in c++ code?