// Use this for initialization void Start() { // Get a reference to the spatial mesh SpatialMapping = GameObject.Find("SpatialMapping"); objectSurfaceObserver = SpatialMapping.GetComponent <ObjectSurfaceObserver>(); layout = layoutInfo.text; }
void Awake() { // on awake initialize clicker, spatial mapping material and other things clickerManager = GetComponent <ClickerManager>(); ClickSwitch = false; logPosRot = mainCamera.GetComponent <LogPosRot>(); mappingMaterial = spatialMapping.GetComponent <SpatialMappingManager>(); objectSurfaceObserver = spatialMapping.GetComponent <ObjectSurfaceObserver>(); var meshmanager = GetComponent <MeshManager>(); // App always starts off mappingMaterial.DrawVisualMeshes = false; }
void Start() { GameObject SpatialMappingObject = GameObject.Find("SpatialMapping"); onSceneMappingObserver = SpatialMappingObject.GetComponent <SpatialMappingObserver>(); onSceneSpatialManager = SpatialMappingObject.GetComponent <SpatialMappingManager>(); onSceneGeommetryDivider = SpatialMappingObject.GetComponent <ObjectSurfaceObserver>(); onSceneMappingObserver.enabled = false; onSceneSpatialManager.autoStartObserver = false; onSceneGeommetryDivider.enabled = false; MRCam = GameObject.FindGameObjectWithTag(TAG_MAIN_CAMERA); informationObject.transform.position = MRCam.transform.position + MRCam.transform.forward * distanceFromCam; informationObject.transform.rotation = Quaternion.LookRotation(informationObject.transform.position - MRCam.transform.position, MRCam.transform.up); }
void InitializeRoom() { // if the spatial mapping object doesn't exist, create it if (spatialMappingObj == null) { InstantiateSpatialMappingPrefab(); } // move the room mesh over to the spatialmappingobj ObjectSurfaceObserver surfaceObserver = spatialMappingObj.GetComponent <ObjectSurfaceObserver>(); surfaceObserver.roomModel = Resources.Load <GameObject>(Constants.Folders.RoomMeshFolderPath + Constants.Names.RoomMeshName + Constants.Suffixes.RoomMeshSuffix); // set the material that the spatialmapping object will use to render it SpatialMappingManager mappingManager = spatialMappingObj.GetComponent <SpatialMappingManager>(); mappingManager.SetSurfaceMaterial(CreateRoomMeshMaterial()); }