public void GetKeyFrames(float frame, out KeyFrame start, out KeyFrame end) { // TODO: this method must be optamized for (int i = 0; i != KeyFrames.Length; ++i) { if (frame >= KeyFrames[i].Cordinate.X && frame <= KeyFrames[i+1].Cordinate.X) { start = KeyFrames[i]; end = KeyFrames[i+1]; return; } } start = null; end = null; }
public FCurve(BinaryReader reader) { Type = (FCurveTypes)reader.ReadInt32(); Index = reader.ReadInt32(); DataPath = reader.ReadString(); KeyFrames = new KeyFrame[reader.ReadInt32()]; for (int i = 0; i != KeyFrames.Length; ++i) { KeyFrames[i] = new KeyFrame(reader); } }