private void ReadCurve(Stream input, int frameIndex, CurveTimeline timeline) { switch (input.ReadByte()) { case CURVE_STEPPED: timeline.SetStepped(frameIndex); break; case CURVE_BEZIER: timeline.SetCurve(frameIndex, ReadFloat(input), ReadFloat(input), ReadFloat(input), ReadFloat(input)); break; } }
static void ReadCurve(Dictionary <String, Object> valueMap, CurveTimeline timeline, int frameIndex) { if (!valueMap.ContainsKey("curve")) { return; } Object curveObject = valueMap["curve"]; if (curveObject.Equals("stepped")) { timeline.SetStepped(frameIndex); } else { var curve = curveObject as List <Object>; if (curve != null) { timeline.SetCurve(frameIndex, (float)curve[0], (float)curve[1], (float)curve[2], (float)curve[3]); } } }