Create a room programmatically

Hello guys.

I recently began working with Unity 3D just for fun and I need somebody to point me on the right direction about a problem I’m facing. I want to be able to create a level programmatically and not by making it on an external program or by using Unity primitives such as cubes. What I want to know first is the basics though, so can anybody please point me to resources that will answer theses questions:

1- how to programmatically draw a mesh that will work as a small room on which the characters can walk;

2- after the mesh is drawn, does Unity take care of drawing only whats near to / visible by the player? If not, how can this be achieved?

Thanks in advance!

  1. Use the Mesh class.
  2. No, aside from the standard frustum culling. You’d have to make some kind of dynamic occlusion culling system.