this is my first post in this stack exchange!
I was wondering how I would go about mapping the texture of my tiles for my tilemap directly to the texture atlas.
I generate the mesh with unique vertices per tile to circumvent having to generate a Texture2D in memory to map all the squares to. I know it's possible to map the uv coords of the vertices to the texture like in the image below, since I have unique vertices per square. But I have no idea how to actually do it in my code. I tried just filling the uv array with random values between 0 and 1 to see if it worked at all but I just get a green mesh, no other colours in there.
Does anyone know a way to implement this?