Exemple #1
0
    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);
    }
Exemple #2
0
 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();
 }