/// <summary> /// Creates a JSON object containing PathTerrain and Path data. /// </summary> /// <returns>A JSON Value containing PathTerrain and Path data. You can ToString this for the JSON string.</returns> public Ferr_JSONValue ToJSON() { Ferr_JSONValue result = new Ferr_JSONValue(); result["fill"] = "" + fill; result["fillY"] = fillY; result["fillZ"] = fillZ; result["splitCorners"] = splitCorners; result["smoothPath"] = smoothPath; result["splitDist"] = splitDist; result["pixelsPerUnit"] = pixelsPerUnit; result["stretchThreshold"] = stretchThreshold; result["vertexColor"] = Ferr_Color.ToHex(vertexColor); result["createCollider"] = createCollider; result["create3DCollider"] = create3DCollider; result["depth"] = depth; result["surfaceOffset.0"] = surfaceOffset[0]; result["surfaceOffset.1"] = surfaceOffset[1]; result["surfaceOffset.2"] = surfaceOffset[2]; result["surfaceOffset.3"] = surfaceOffset[3]; result["colliders.bottom"] = collidersBottom; result["colliders.top"] = collidersTop; result["colliders.left"] = collidersLeft; result["colliders.right"] = collidersRight; result["directionOverrides"] = 0; Ferr_JSONValue dir = result["directionOverrides"]; for (int i = 0; i < directionOverrides.Count; i++) { dir[i] = directionOverrides[i].ToString(); } result["path"] = path.ToJSON(); return(result); }