private void InitIfNeeded()
{
if (styles == null)
{
styles = new Styles();
}
if (this.m_ColorLibraryEditorState == null)
{
this.m_ColorLibraryEditorState = new PresetLibraryEditorState(presetsEditorPrefID);
this.m_ColorLibraryEditorState.TransferEditorPrefsState(true);
}
if (this.m_ColorLibraryEditor == null)
{
ScriptableObjectSaveLoadHelper<ColorPresetLibrary> helper = new ScriptableObjectSaveLoadHelper<ColorPresetLibrary>("colors", SaveType.Text);
this.m_ColorLibraryEditor = new PresetLibraryEditor<ColorPresetLibrary>(helper, this.m_ColorLibraryEditorState, new Action<int, object>(this.PresetClickedCallback));
this.m_ColorLibraryEditor.previewAspect = 1f;
this.m_ColorLibraryEditor.minMaxPreviewHeight = new Vector2(14f, 14f);
this.m_ColorLibraryEditor.settingsMenuRightMargin = 2f;
this.m_ColorLibraryEditor.useOnePixelOverlappedGrid = true;
this.m_ColorLibraryEditor.alwaysShowScrollAreaHorizontalLines = false;
this.m_ColorLibraryEditor.marginsForGrid = new RectOffset(0, 0, 0, 0);
this.m_ColorLibraryEditor.marginsForList = new RectOffset(0, 5, 2, 2);
this.m_ColorLibraryEditor.InitializeGrid(233f - (styles.background.padding.left + styles.background.padding.right));
}
}