示例#1
0
        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;
            }
        }
示例#2
0
        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]);
            }
        }