Exemplo n.º 1
0
        /// <summary>
        /// Draws the toolbar above the window.
        /// </summary>
        private void DrawToolbar()
        {
            GUILayout.BeginHorizontal(EditorStyles.toolbar);
            if (GUILayout.Button(" Datastore Library ", EditorStyles.toolbarButton))
            {
                DatastoreLibrary.Init();
            }

            GUILayout.FlexibleSpace();

            if (m_so != null)
            {
                GUILayout.Label("ElementsPerPage");
                SerializedProperty editorVars      = m_so.FindProperty(EDITOR_VARIABLES_PATH);
                SerializedProperty elementsPerPage = editorVars.FindPropertyRelative("ElementsPerPage");

                EditorGUI.BeginChangeCheck();
                elementsPerPage.intValue = Mathf.Clamp(EditorGUILayout.IntField(elementsPerPage.intValue,
                                                                                GUILayout.Height(14), GUILayout.Width(22)), 1, 99);
                if (EditorGUI.EndChangeCheck())
                {
                    editorVars.FindPropertyRelative("CurrentPage").intValue = -1;
                    editorVars.FindPropertyRelative("TotalPages").intValue  = -1;
                    m_so.ApplyModifiedProperties();
                }
            }
            GUILayout.EndHorizontal();
        }
Exemplo n.º 2
0
        public static void Init()
        {
            DatastoreLibrary instance = GetWindow <DatastoreLibrary>("Library");

            instance.Show(true);
            instance.Focus();
        }