Runtime mesh generation material problem (Distort on textures when i scaled them)

Hi;

I am generation meshes on runtime and textures are distorting.Look the floor and walls on image. Also i am trying to instantiate cube and generate walls with scaling this cube.But when i add material to this cube materials are resizing like mesh.But i dont want to scale materials i just want to scale mesh.How can i do this ?

Thanks again and sorry for my bad english

You can set texture scale on the material to “repeat” the number of times wanted on the mesh - this means you will need to calculate what size the material normally would fit un-scaled, and use that ratio to determine how many times it should repeat over the new size. Be sure the texture isn’t set to clamp.