private void InitIfNeeded() { if (ColorPicker.styles == null) { ColorPicker.styles = new ColorPicker.Styles(); } if (this.m_ColorLibraryEditorState == null) { this.m_ColorLibraryEditorState = new PresetLibraryEditorState(ColorPicker.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(193f - (float)(ColorPicker.styles.background.padding.left + ColorPicker.styles.background.padding.right)); } }
private void InitIfNeeded() { if (ColorPicker.styles == null) ColorPicker.styles = new ColorPicker.Styles(); if (this.m_ColorLibraryEditorState == null) { this.m_ColorLibraryEditorState = new PresetLibraryEditorState(ColorPicker.presetsEditorPrefID); this.m_ColorLibraryEditorState.TransferEditorPrefsState(true); } if (this.m_ColorLibraryEditor != null) return; this.m_ColorLibraryEditor = new PresetLibraryEditor<ColorPresetLibrary>(new ScriptableObjectSaveLoadHelper<ColorPresetLibrary>("colors", SaveType.Text), this.m_ColorLibraryEditorState, new System.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 - (float) (ColorPicker.styles.background.padding.left + ColorPicker.styles.background.padding.right)); }