public void InitIfNeeded() { if (this.m_CurveLibraryEditorState == null) { this.m_CurveLibraryEditorState = new PresetLibraryEditorState(this.GetEditorPrefBaseName()); this.m_CurveLibraryEditorState.TransferEditorPrefsState(true); } if (this.m_CurveLibraryEditor != null) return; this.m_CurveLibraryEditor = new PresetLibraryEditor<DoubleCurvePresetLibrary>(new ScriptableObjectSaveLoadHelper<DoubleCurvePresetLibrary>(PresetLibraryLocations.GetParticleCurveLibraryExtension(this.m_DoubleCurve.IsSingleCurve(), this.m_DoubleCurve.signedRange), SaveType.Text), this.m_CurveLibraryEditorState, new System.Action<int, object>(this.ItemClickedCallback)); this.m_CurveLibraryEditor.addDefaultPresets += new System.Action<PresetLibrary>(this.AddDefaultPresetsToLibrary); this.m_CurveLibraryEditor.presetsWasReordered = new System.Action(this.PresetsWasReordered); this.m_CurveLibraryEditor.previewAspect = 4f; this.m_CurveLibraryEditor.minMaxPreviewHeight = new Vector2(24f, 24f); this.m_CurveLibraryEditor.showHeader = true; }
public void InitIfNeeded() { if (this.m_CurveLibraryEditorState == null) { this.m_CurveLibraryEditorState = new PresetLibraryEditorState(GetBasePrefText(this.m_CurveLibraryType)); this.m_CurveLibraryEditorState.TransferEditorPrefsState(true); } if (this.m_CurveLibraryEditor == null) { ScriptableObjectSaveLoadHelper<CurvePresetLibrary> helper = new ScriptableObjectSaveLoadHelper<CurvePresetLibrary>(GetExtension(this.m_CurveLibraryType), SaveType.Text); this.m_CurveLibraryEditor = new PresetLibraryEditor<CurvePresetLibrary>(helper, this.m_CurveLibraryEditorState, new Action<int, object>(this.ItemClickedCallback)); this.m_CurveLibraryEditor.addDefaultPresets = (Action<PresetLibrary>) Delegate.Combine(this.m_CurveLibraryEditor.addDefaultPresets, new Action<PresetLibrary>(this.AddDefaultPresetsToLibrary)); this.m_CurveLibraryEditor.presetsWasReordered = (System.Action) Delegate.Combine(this.m_CurveLibraryEditor.presetsWasReordered, new System.Action(this.OnPresetsWasReordered)); this.m_CurveLibraryEditor.previewAspect = 4f; this.m_CurveLibraryEditor.minMaxPreviewHeight = new Vector2(24f, 24f); this.m_CurveLibraryEditor.showHeader = true; } }
private void InitIfNeeded() { if (this.m_GradientEditor == null) { this.m_GradientEditor = new GradientEditor(); this.m_GradientEditor.Init(this.m_Gradient, 0); } if (this.m_GradientLibraryEditorState == null) { this.m_GradientLibraryEditorState = new PresetLibraryEditorState(presetsEditorPrefID); this.m_GradientLibraryEditorState.TransferEditorPrefsState(true); } if (this.m_GradientLibraryEditor == null) { ScriptableObjectSaveLoadHelper<GradientPresetLibrary> helper = new ScriptableObjectSaveLoadHelper<GradientPresetLibrary>("gradients", SaveType.Text); this.m_GradientLibraryEditor = new PresetLibraryEditor<GradientPresetLibrary>(helper, this.m_GradientLibraryEditorState, new Action<int, object>(this.PresetClickedCallback)); this.m_GradientLibraryEditor.showHeader = true; this.m_GradientLibraryEditor.minMaxPreviewHeight = new Vector2(14f, 14f); } }
public void InitIfNeeded() { if (this.m_CurveLibraryEditorState == null) { this.m_CurveLibraryEditorState = new PresetLibraryEditorState(this.GetEditorPrefBaseName()); this.m_CurveLibraryEditorState.TransferEditorPrefsState(true); } if (this.m_CurveLibraryEditor == null) { string particleCurveLibraryExtension = PresetLibraryLocations.GetParticleCurveLibraryExtension(this.m_DoubleCurve.IsSingleCurve(), this.m_DoubleCurve.signedRange); ScriptableObjectSaveLoadHelper<DoubleCurvePresetLibrary> helper = new ScriptableObjectSaveLoadHelper<DoubleCurvePresetLibrary>(particleCurveLibraryExtension, SaveType.Text); this.m_CurveLibraryEditor = new PresetLibraryEditor<DoubleCurvePresetLibrary>(helper, this.m_CurveLibraryEditorState, new Action<int, object>(this.ItemClickedCallback)); PresetLibraryEditor<DoubleCurvePresetLibrary> expr_7B = this.m_CurveLibraryEditor; expr_7B.addDefaultPresets = (Action<PresetLibrary>)Delegate.Combine(expr_7B.addDefaultPresets, new Action<PresetLibrary>(this.AddDefaultPresetsToLibrary)); this.m_CurveLibraryEditor.presetsWasReordered = new Action(this.PresetsWasReordered); this.m_CurveLibraryEditor.previewAspect = 4f; this.m_CurveLibraryEditor.minMaxPreviewHeight = new Vector2(24f, 24f); this.m_CurveLibraryEditor.showHeader = true; } }
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)); }
public void InitIfNeeded() { if (this.m_CurveLibraryEditorState == null) { this.m_CurveLibraryEditorState = new PresetLibraryEditorState(CurvePresetsContentsForPopupWindow.GetBasePrefText(this.m_CurveLibraryType)); this.m_CurveLibraryEditorState.TransferEditorPrefsState(true); } if (this.m_CurveLibraryEditor != null) return; this.m_CurveLibraryEditor = new PresetLibraryEditor<CurvePresetLibrary>(new ScriptableObjectSaveLoadHelper<CurvePresetLibrary>(CurvePresetsContentsForPopupWindow.GetExtension(this.m_CurveLibraryType), SaveType.Text), this.m_CurveLibraryEditorState, new System.Action<int, object>(this.ItemClickedCallback)); this.m_CurveLibraryEditor.addDefaultPresets += new System.Action<PresetLibrary>(this.AddDefaultPresetsToLibrary); this.m_CurveLibraryEditor.presetsWasReordered += new System.Action(this.OnPresetsWasReordered); this.m_CurveLibraryEditor.previewAspect = 4f; this.m_CurveLibraryEditor.minMaxPreviewHeight = new Vector2(24f, 24f); this.m_CurveLibraryEditor.showHeader = true; }