In Unity3D there are two ways to handle spatial mapping. Well, to be honest, there are three, but I will leave the third option for Chapter 8, Speed up Your Development – Advanced Unity3D. For now, we will focus on the things Unity3D gives us out-of-the-box.
There is an easy way and a harder way. The easiest way is a matter of just dropping one or two components into your scene. The harder way is to write the code to do yourself what those components do for you. Needless to say, the harder way is the more flexible way. You can achieve things you cannot achieve doing it the easy way.
However, rest assured, the harder way is nowhere near as complicated as the things we looked at in the part about DirectX. There are a lot of similarities, of course, but you will find the code is a lot easier to understand. So, we will start with the harder...