Writing scripts for spatial mapping in Unity3D