public Init ( |
||
gradient | ||
numSteps | int | |
return | void |
private void Init(Gradient newGradient, bool hdr) { m_Gradient = newGradient; m_HDR = hdr; if (m_GradientEditor != null) { m_GradientEditor.Init(newGradient, k_DefaultNumSteps, m_HDR); } Repaint(); }
private void Init(Gradient newGradient, bool hdr, ColorSpace colorSpace) { m_Gradient = newGradient; m_HDR = hdr; m_ColorSpace = colorSpace; if (m_GradientEditor != null) { m_GradientEditor.Init(newGradient, k_DefaultNumSteps, m_HDR, m_ColorSpace); } Repaint(); }
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); } }