// Called every frame. private void Update() { // Keyboard commands for saving and loading a remotely generated mesh file. #if UNITY_EDITOR || UNITY_STANDALONE // S - saves the active mesh if (Input.GetKeyUp(SaveFileKey)) { MeshSaver.Save(MeshFileName, SpatialMappingManager.Instance.GetMeshes()); } // L - loads the previously saved mesh into editor and sets it to be the spatial mapping source. if (Input.GetKeyUp(LoadFileKey)) { SpatialMappingManager.Instance.SetSpatialMappingSource(this); Load(MeshFileName); } #endif }
/// <summary> /// Saves all the currently created spatial source meshes in world space. /// </summary> /// <param name="fileName">Name to give the mesh file. Exclude path and extension.</param> public void SaveSpatialMeshes(string fileName) { MeshSaver.Save(fileName, GetMeshFilters()); }