// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.F1)) { XMLVoxelFileWriter.SaveChunkToXML(terrainArray, "VoxelChunk"); } if (Input.GetKeyDown(KeyCode.F2)) { } }
public override void OnInspectorGUI() { VoxelChunk myTarget = (VoxelChunk)target; fileName = EditorGUILayout.TextField(fileName); if (GUILayout.Button("Load from XML")) { myTarget.LoadChunk(fileName); } if (GUILayout.Button("Save to XML")) { XMLVoxelFileWriter.SaveChunkToXML(myTarget.terrainArray, "VoxelChunk"); } if (GUILayout.Button("Clear Terrain")) { myTarget.GetComponent <VoxelGen>().ClearPrevData(); } }