TransferEditorPrefsState() public method

public TransferEditorPrefsState ( bool load ) : void
load bool
return void
Esempio n. 1
0
        public void OnDisable()
        {
            //EditorApplication.playmodeStateChanged -= OnPlayModeStateChanged;
            if (m_GradientLibraryEditorState != null)
            {
                m_GradientLibraryEditorState.TransferEditorPrefsState(false);
            }

            s_GradientPicker = null;
        }
        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;
            }
        }
Esempio n. 4
0
        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 override void OnClose()
 {
     m_CurveLibraryEditorState.TransferEditorPrefsState(false);
 }