private void Start() { meshVisualizer = GetComponent <ARFaceMeshVisualizer>(); meshVisualizer.enabled = false; renderer = GetComponent <MeshRenderer>(); renderer.enabled = false; }
public void SaveMesh() { ARFaceMeshVisualizer arFaceMeshVisualizer = FindObjectOfType <ARFaceMeshVisualizer>(); if (!arFaceMeshVisualizer) { Debug.Log("Could not find face mesh visualizer"); return; } SerializableFaceGeometry sfg = new SerializableFaceGeometry(arFaceMeshVisualizer.mesh); var jsonMesh = JsonUtility.ToJson(sfg); string filePath = Application.persistentDataPath + "/savedFaceMesh.json"; File.WriteAllText(filePath, jsonMesh); }