private void PrepareKeyFrames() { if (_fromKeyFrame != null) { KeyFrames.Remove(_fromKeyFrame); } if (_toKeyFrame != null) { KeyFrames.Remove(_toKeyFrame); } if (!IsValueNull(From)) { _fromKeyFrame = new TKeyFrame(); _fromKeyFrame.Key = 0f; _fromKeyFrame.Value = From; KeyFrames.Add(_fromKeyFrame); } if (!IsValueNull(To)) { _toKeyFrame = new TKeyFrame(); _toKeyFrame.Key = 1f; _toKeyFrame.Value = To; KeyFrames.Add(_toKeyFrame); } }
protected void PrepareKeyFrames() { if (FromKeyFrame != null) { KeyFrames.Remove(FromKeyFrame); } if (ToKeyFrame != null) { KeyFrames.Remove(ToKeyFrame); } if (!IsValueNull(From)) { FromKeyFrame = new T(); FromKeyFrame.Key = 0f; FromKeyFrame.Value = From; KeyFrames.Add(FromKeyFrame); } if (!IsValueNull(To)) { ToKeyFrame = new T(); ToKeyFrame.Key = 1f; ToKeyFrame.Value = To; KeyFrames.Add(ToKeyFrame); } }
/// <summary> /// Removes a KeyFrame /// </summary> /// <param name="frame"></param> public void RemoveKeyFrame(KeyFrame frame) { if (frame == null) { return; } if (KeyFrames.Contains(frame)) { KeyFrames.Remove(frame); } }