UnityEditor.PresetLibraryEditorState.TransferEditorPrefsState C# (CSharp) Method

TransferEditorPrefsState() public method

public TransferEditorPrefsState ( bool load ) : void
load bool
return void
        public void TransferEditorPrefsState(bool load)
        {
            if (load)
            {
                this.m_ItemViewMode = (ItemViewMode) EditorPrefs.GetInt(this.m_Prefix + "ViewMode", (int) this.m_ItemViewMode);
                this.m_PreviewHeight = EditorPrefs.GetFloat(this.m_Prefix + "ItemHeight", this.m_PreviewHeight);
                this.m_ScrollPosition.y = EditorPrefs.GetFloat(this.m_Prefix + "Scroll", this.m_ScrollPosition.y);
                this.m_CurrrentLibrary = EditorPrefs.GetString(this.m_Prefix + "CurrentLib", this.m_CurrrentLibrary);
            }
            else
            {
                EditorPrefs.SetInt(this.m_Prefix + "ViewMode", (int) this.m_ItemViewMode);
                EditorPrefs.SetFloat(this.m_Prefix + "ItemHeight", this.m_PreviewHeight);
                EditorPrefs.SetFloat(this.m_Prefix + "Scroll", this.m_ScrollPosition.y);
                EditorPrefs.SetString(this.m_Prefix + "CurrentLib", this.m_CurrrentLibrary);
            }
        }

Usage Example

示例#1
0
        public void OnDisable()
        {
            //EditorApplication.playmodeStateChanged -= OnPlayModeStateChanged;
            if (m_GradientLibraryEditorState != null)
            {
                m_GradientLibraryEditorState.TransferEditorPrefsState(false);
            }

            s_GradientPicker = null;
        }
All Usage Examples Of UnityEditor.PresetLibraryEditorState::TransferEditorPrefsState