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)); } }
public override void OnInspectorGUI() { this.m_GenericPresetLibraryInspector.itemViewMode = PresetLibraryEditorState.GetItemViewMode("Gradient"); if (this.m_GenericPresetLibraryInspector != null) { this.m_GenericPresetLibraryInspector.OnInspectorGUI(); } }
public override void OnInspectorGUI() { this.m_GenericPresetLibraryInspector.itemViewMode = PresetLibraryEditorState.GetItemViewMode(ColorPicker.presetsEditorPrefID); if (this.m_GenericPresetLibraryInspector != null) { this.m_GenericPresetLibraryInspector.OnInspectorGUI(); } }
public override void OnInspectorGUI() { m_GenericPresetLibraryInspector.itemViewMode = PresetLibraryEditorState.GetItemViewMode("Gradient"); // ensure in-sync if (m_GenericPresetLibraryInspector != null) { m_GenericPresetLibraryInspector.OnInspectorGUI(); } }
public override void OnInspectorGUI() { m_GenericPresetLibraryInspector.itemViewMode = PresetLibraryEditorState.GetItemViewMode(ColorPicker.presetsEditorPrefID); // ensure in-sync if (m_GenericPresetLibraryInspector != null) { m_GenericPresetLibraryInspector.OnInspectorGUI(); } }
public override void OnInspectorGUI() { this.m_GenericPresetLibraryInspector.itemViewMode = PresetLibraryEditorState.GetItemViewMode(CurvePresetsContentsForPopupWindow.GetBasePrefText(this.m_CurveLibraryType)); if (this.m_GenericPresetLibraryInspector == null) { return; } this.m_GenericPresetLibraryInspector.OnInspectorGUI(); }
public override void OnInspectorGUI() { string editorPrefPrefix = CurvePresetsContentsForPopupWindow.GetBasePrefText(m_CurveLibraryType); m_GenericPresetLibraryInspector.itemViewMode = PresetLibraryEditorState.GetItemViewMode(editorPrefPrefix); // ensure in-sync if (m_GenericPresetLibraryInspector != null) { m_GenericPresetLibraryInspector.OnInspectorGUI(); } }
public PresetLibraryEditor(ScriptableObjectSaveLoadHelper <T> helper, PresetLibraryEditorState state, System.Action <int, object> itemClickedCallback) { this.m_SaveLoadHelper = helper; this.m_State = state; this.m_ItemClickedCallback = itemClickedCallback; this.settingsMenuRightMargin = 10f; this.useOnePixelOverlappedGrid = false; this.alwaysShowScrollAreaHorizontalLines = true; this.marginsForList = new RectOffset(10, 10, 5, 5); this.marginsForGrid = new RectOffset(5, 5, 5, 5); this.m_PresetLibraryFileLocation = PresetLibraryLocations.GetFileLocationFromPath(this.currentLibraryWithoutExtension); }
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 PresetLibraryEditor(ScriptableObjectSaveLoadHelper <T> helper, PresetLibraryEditorState state, Action <int, object> itemClickedCallback) { this.m_DragState = new DragState <T>(); this.m_Grid = new VerticalGrid(); this.m_MinMaxPreviewHeight = new Vector2(14f, 64f); this.m_PreviewAspect = 8f; this.m_ShowAddNewPresetItem = true; this.m_IsOpenForEdit = true; this.m_SaveLoadHelper = helper; this.m_State = state; this.m_ItemClickedCallback = itemClickedCallback; this.settingsMenuRightMargin = 10f; this.useOnePixelOverlappedGrid = false; this.alwaysShowScrollAreaHorizontalLines = true; this.marginsForList = new RectOffset(10, 10, 5, 5); this.marginsForGrid = new RectOffset(5, 5, 5, 5); this.m_PresetLibraryFileLocation = PresetLibraryLocations.GetFileLocationFromPath(this.currentLibraryWithoutExtension); }
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; } }
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; }
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 = (Action)Delegate.Combine(this.m_CurveLibraryEditor.presetsWasReordered, new Action(this.OnPresetsWasReordered)); 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(this.GetEditorPrefBaseName()); this.m_CurveLibraryEditorState.TransferEditorPrefsState(true); } if (this.m_CurveLibraryEditor == null) { ScriptableObjectSaveLoadHelper <DoubleCurvePresetLibrary> helper = new ScriptableObjectSaveLoadHelper <DoubleCurvePresetLibrary>(PresetLibraryLocations.GetParticleCurveLibraryExtension(this.m_DoubleCurve.IsSingleCurve(), this.m_DoubleCurve.signedRange), SaveType.Text); this.m_CurveLibraryEditor = new PresetLibraryEditor <DoubleCurvePresetLibrary>(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 = new 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 (m_CurveLibraryEditorState == null) { m_CurveLibraryEditorState = new PresetLibraryEditorState(GetBasePrefText(m_CurveLibraryType)); m_CurveLibraryEditorState.TransferEditorPrefsState(true); } if (m_CurveLibraryEditor == null) { var saveLoadHelper = new ScriptableObjectSaveLoadHelper <CurvePresetLibrary>(GetExtension(m_CurveLibraryType), SaveType.Text); m_CurveLibraryEditor = new PresetLibraryEditor <CurvePresetLibrary>(saveLoadHelper, m_CurveLibraryEditorState, ItemClickedCallback); m_CurveLibraryEditor.addDefaultPresets += AddDefaultPresetsToLibrary; m_CurveLibraryEditor.presetsWasReordered += OnPresetsWasReordered; m_CurveLibraryEditor.previewAspect = 4f; m_CurveLibraryEditor.minMaxPreviewHeight = new Vector2(24f, 24f); m_CurveLibraryEditor.showHeader = true; } }
public void InitIfNeeded() { if (m_CurveLibraryEditorState == null) { m_CurveLibraryEditorState = new PresetLibraryEditorState(GetEditorPrefBaseName()); m_CurveLibraryEditorState.TransferEditorPrefsState(true); } if (m_CurveLibraryEditor == null) { var extension = PresetLibraryLocations.GetParticleCurveLibraryExtension(m_DoubleCurve.IsSingleCurve(), m_DoubleCurve.signedRange); var saveLoadHelper = new ScriptableObjectSaveLoadHelper <DoubleCurvePresetLibrary>(extension, SaveType.Text); m_CurveLibraryEditor = new PresetLibraryEditor <DoubleCurvePresetLibrary>(saveLoadHelper, m_CurveLibraryEditorState, ItemClickedCallback); m_CurveLibraryEditor.addDefaultPresets += AddDefaultPresetsToLibrary; m_CurveLibraryEditor.presetsWasReordered = PresetsWasReordered; m_CurveLibraryEditor.previewAspect = 4f; m_CurveLibraryEditor.minMaxPreviewHeight = new Vector2(24f, 24f); 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 (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(GradientPicker.presetsEditorPrefID); this.m_GradientLibraryEditorState.TransferEditorPrefsState(true); } if (this.m_GradientLibraryEditor != null) { return; } this.m_GradientLibraryEditor = new PresetLibraryEditor <GradientPresetLibrary>(new ScriptableObjectSaveLoadHelper <GradientPresetLibrary>("gradients", SaveType.Text), this.m_GradientLibraryEditorState, new System.Action <int, object>(this.PresetClickedCallback)); this.m_GradientLibraryEditor.showHeader = true; this.m_GradientLibraryEditor.minMaxPreviewHeight = new Vector2(14f, 14f); }
void InitIfNeeded() { // Init editor when needed if (m_GradientEditor == null) { m_GradientEditor = new GradientEditor(); m_GradientEditor.Init(m_Gradient, k_DefaultNumSteps, m_HDR); } if (m_GradientLibraryEditorState == null) { m_GradientLibraryEditorState = new PresetLibraryEditorState(presetsEditorPrefID); m_GradientLibraryEditorState.TransferEditorPrefsState(true); } if (m_GradientLibraryEditor == null) { var saveLoadHelper = new ScriptableObjectSaveLoadHelper <GradientPresetLibrary>("gradients", SaveType.Text); m_GradientLibraryEditor = new PresetLibraryEditor <GradientPresetLibrary>(saveLoadHelper, m_GradientLibraryEditorState, PresetClickedCallback); m_GradientLibraryEditor.showHeader = true; m_GradientLibraryEditor.minMaxPreviewHeight = new Vector2(14f, 14f); } }
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; }
public PresetLibraryGradientEditor(ScriptableObjectSaveLoadHelper <GradientPresetLibrary> helper, PresetLibraryEditorState state, System.Action <int, object> itemClickedCallback ) : base(helper, state, itemClickedCallback) { }
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)); }