void InitCurvePresets() { if (m_CurvePresets == null) { // Selection callback for library window Action <AnimationCurve> presetSelectedCallback = delegate(AnimationCurve presetCurve) { ValidateCurveLibraryTypeAndScale(); // Scale curve up using ranges m_Curve.keys = GetDenormalizedKeys(presetCurve.keys); m_Curve.postWrapMode = presetCurve.postWrapMode; m_Curve.preWrapMode = presetCurve.preWrapMode; m_CurveEditor.SelectNone(); RefreshShownCurves(); SendEvent(CurveChangedCommand, true); }; // We set the curve to save when showing the popup to ensure to scale the current state of the curve AnimationCurve curveToSaveAsPreset = null; m_CurvePresets = new CurvePresetsContentsForPopupWindow(curveToSaveAsPreset, curveLibraryType, presetSelectedCallback); m_CurvePresets.InitIfNeeded(); } }