4 using System.Collections.Generic;
15 [Tooltip(
"The file name to use when saving and loading meshes.")]
16 public string MeshFileName =
"roombackup";
18 [Tooltip(
"Key to press in editor to load a spatial mapping mesh from a .room file.")]
19 public KeyCode LoadFileKey = KeyCode.L;
21 [Tooltip(
"Key to press in editor to save a spatial mapping mesh to file.")]
22 public KeyCode SaveFileKey = KeyCode.S;
28 public void Load(
string fileName)
30 if (
string.IsNullOrEmpty(fileName))
32 Debug.Log(
"No mesh file specified.");
42 for(
int iMesh = 0; iMesh < storedMeshes.Count; iMesh++)
44 AddSurfaceObject(CreateSurfaceObject(
45 mesh: storedMeshes[iMesh],
46 objectName:
"storedmesh-" + iMesh,
47 parentObject: transform,
54 Debug.Log(
"Failed to load " + fileName);
62 #if UNITY_EDITOR || UNITY_STANDALONE 64 if (Input.GetKeyUp(SaveFileKey))
70 if (Input.GetKeyUp(LoadFileKey))
81 public class FileSurfaceObserverEditor : Editor
83 public override void OnInspectorGUI()
85 base.OnInspectorGUI();
88 if (GUILayout.Button(
"Open File Location"))