Instantiate an object until edges of floor

Hello, guys. I want to instantiate multiple tiles just along the floor. I want that tiles be cut when it reaches the end of the edge of the floor automatically. Please help me to create that C# script. 96991-capture.png

What do you mean with ‘cut’ can you gives us a little more information please.

As I marked in the picture that I want to get rid of the residual piece of tile. I want that the script instantiates the tiles along the floor (Obj.2) and cut (or, don’t show) the residual piece of tile which is going away the floor.