private void ReadCurve(CurveTimeline timeline, int frameIndex, Dictionary <String, Object> valueMap) { if (!valueMap.ContainsKey("curve")) { return; } Object curveObject = valueMap["curve"]; if (curveObject.Equals("stepped")) { timeline.SetStepped(frameIndex); } else if (curveObject is List <Object> ) { var curve = (List <Object>)curveObject; timeline.SetCurve(frameIndex, (float)curve[0], (float)curve[1], (float)curve[2], (float)curve[3]); } }
private static void ReadCurve(Dictionary <string, object> valueMap, CurveTimeline timeline, int frameIndex) { if (!valueMap.ContainsKey("curve")) { return; } object obj = valueMap["curve"]; if (obj.Equals("stepped")) { timeline.SetStepped(frameIndex); return; } List <object> list = obj as List <object>; if (list != null) { timeline.SetCurve(frameIndex, (float)list[0], (float)list[1], (float)list[2], (float)list[3]); } }
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]); } } }
private void ReadCurve (CurveTimeline timeline, int frameIndex, Dictionary<String, Object> valueMap) { if (!valueMap.ContainsKey("curve")) return; Object curveObject = valueMap["curve"]; if (curveObject.Equals("stepped")) timeline.SetStepped(frameIndex); else if (curveObject is List<Object>) { var curve = (List<Object>)curveObject; timeline.SetCurve(frameIndex, (float)curve[0], (float)curve[1], (float)curve[2], (float)curve[3]); } }
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]); } }
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; } }