コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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));
        }