CreateKeyFrame() public method

Creates a new KeyFrame and adds it to this animation at the given time index.
It is better to create KeyFrames in time order. Creating them out of order can result in expensive reordering processing. Note that a KeyFrame at time index 0.0 is always created for you, so you don't need to create this one, just access it using KeyFrames[0];
public CreateKeyFrame ( float time ) : KeyFrame
time float Time within the animation at which this keyframe will lie.
return KeyFrame
        protected void ReadKeyFrame(XmlNode node, AnimationTrack track)
        {
            float time = float.Parse(node.Attributes["time"].Value);
            // create a new keyframe with the specified length
            TransformKeyFrame keyFrame = (TransformKeyFrame)track.CreateKeyFrame(time);

            foreach (XmlNode childNode in node.ChildNodes) {
                switch (childNode.Name) {
                    case "translate":
                        keyFrame.Translate = ReadVector3(childNode);
                        break;
                    case "rotate":
                        ReadRotate(childNode, keyFrame);
                        break;
                    default:
                        DebugMessage(childNode);
                        break;
                }
            }
        }
 protected void AddKey(AnimationTrack track, float time, Vector3 translate)
 {
     TransformKeyFrame key = (TransformKeyFrame)track.CreateKeyFrame(time);
     key.Translate = translate;
 }