public void WriteAttribute(Attribute attr, ColorSequence value) { attr.WriteInt(value.Keypoints.Length); foreach (var keypoint in value.Keypoints) { attr.WriteInt(keypoint.Envelope); attr.WriteFloat(keypoint.Time); Color3Token.WriteColor3(attr, keypoint.Value); } }
public ColorSequence ReadAttribute(Attribute attr) { int numKeys = attr.ReadInt(); var keypoints = new ColorSequenceKeypoint[numKeys]; for (int i = 0; i < numKeys; i++) { int envelope = attr.ReadInt(); float time = attr.ReadFloat(); Color3 value = Color3Token.ReadColor3(attr); keypoints[i] = new ColorSequenceKeypoint(time, value, envelope); } return(new ColorSequence(keypoints)); }