private String WriteObjectToJson(HeightAdjustmentObject heightAdjustmentObject) { /*String outString = "{\n" + * " \"adjustment\": " + heightAdjustmentObject.GetHeightAdjustment().adjustment + ",\n" + * " \"radius\": " + heightAdjustmentObject.GetHeightAdjustment().radius + ",\n" + * " \"pos\": [\n" + * " " + heightAdjustmentObject.GetHeightAdjustment().pos[0] + ",\n" + * " " + heightAdjustmentObject.GetHeightAdjustment().pos[1] + ",\n" + * " " + heightAdjustmentObject.GetHeightAdjustment().pos[2] + "\n" + * " ]\n" + * "}";*/ String outString = JsonUtility.ToJson(heightAdjustmentObject.GetHeightAdjustment(), true); return(outString); }
private void SetActiveObject(HeightAdjustmentObject active) { if (activeObject != null) { activeObject.GetComponent <MeshRenderer>().material = sphereMaterial; } activeObject = active; activeObject.GetComponent <MeshRenderer>().material = selectedMaterial; jsonDataForCurrentObject.text = WriteObjectToJson(activeObject); SetRadiusForActiveObject(activeObject.Radius); SetHeightForActiveObject(activeObject.Adjustment); adjustmentXInput.text = activeObject.Pos.x.ToString(); adjustmentYInput.text = activeObject.Pos.y.ToString(); adjustmentZInput.text = activeObject.Pos.z.ToString(); }