public void deserialize(JObject data) { int count = (int)data["anchorCount"]; curveType = (string)data["anchorType"]; for (int i = 0; i < count; i++) { var value = ((string)data["anchor_" + i]).Split(','); maxCurveAnchorValue = UnityEngine.Mathf.Max(maxCurveAnchorValue, float.Parse(value[1])); anchors.Add(new CurveAnchor(float.Parse(value[0]), float.Parse(value[1]))); } ValueTypeUtil.NormalizeCurveAnchor(anchors, maxCurveAnchorValue); }
public void deserialize(JObject data) { int count = (int)data["anchorXCount"]; curveTypeX = (string)data["anchorXType"]; for (int i = 0; i < count; i++) { var value = ((string)data["anchorX" + i]).Split(','); anchorsX.Add(new CurveAnchor(float.Parse(value[0]), float.Parse(value[1]))); maxXYZ[0] = UnityEngine.Mathf.Max(maxXYZ[0], float.Parse(value[1])); } ValueTypeUtil.NormalizeCurveAnchor(anchorsX, maxXYZ[0]); count = (int)data["anchorYCount"]; curveTypeY = (string)data["anchorYType"]; for (int i = 0; i < count; i++) { var value = ((string)data["anchorY" + i]).Split(','); anchorsY.Add(new CurveAnchor(float.Parse(value[0]), float.Parse(value[1]))); maxXYZ[1] = UnityEngine.Mathf.Max(maxXYZ[1], float.Parse(value[1])); } ValueTypeUtil.NormalizeCurveAnchor(anchorsY, maxXYZ[1]); count = (int)data["anchorZCount"]; curveTypeZ = (string)data["anchorZType"]; for (int i = 0; i < count; i++) { var value = ((string)data["anchorZ" + i]).Split(','); anchorsZ.Add(new CurveAnchor(float.Parse(value[0]), float.Parse(value[1]))); maxXYZ[2] = UnityEngine.Mathf.Max(maxXYZ[2], float.Parse(value[1])); } ValueTypeUtil.NormalizeCurveAnchor(anchorsZ, maxXYZ[2]); }