Save() public static method

Saves the provided meshes to the specified file.
Determines the save path to use and automatically applies the file extension.
public static Save ( string fileName, IEnumerable meshes ) : string
fileName string Name to give the saved mesh file. Exclude path and extension.
meshes IEnumerable The collection of Mesh objects to save.
return string
示例#1
0
        // Called every frame.
        private void Update()
        {
            // Keyboard commands for saving and loading a remotely generated mesh file.
#if UNITY_EDITOR
            // S - saves the active mesh
            if (Input.GetKeyUp(KeyCode.S))
            {
                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(KeyCode.L))
            {
                SpatialMappingManager.Instance.SetSpatialMappingSource(this);
                Load(MeshFileName);
            }
#endif
        }
示例#2
0
        // Called every frame.
        private void Update()
        {
            // There are a few keyboard commands we will add when in the editor.
#if UNITY_EDITOR
            // F - to use the 'file' sourced mesh.
            if (Input.GetKeyUp(KeyCode.B))
            {
                SpatialMappingManager.Instance.SetSpatialMappingSource(fileSurfaceObserver);
            }

            // S - saves the active mesh
            if (Input.GetKeyUp(KeyCode.M))
            {
                MeshSaver.Save(fileSurfaceObserver.MeshFileName, SpatialMappingManager.Instance.GetMeshes());
            }

            // L - loads the previously saved mesh into the file source.
            if (Input.GetKeyUp(KeyCode.L))
            {
                fileSurfaceObserver.Load(fileSurfaceObserver.MeshFileName);
            }
#endif
        }