Esempio n. 1
0
        // INITIALIZERS: --------------------------------------------------------------------------

        public static void Create(IDatabaseEditor editor)
        {
            if (WINDOWS == null)
            {
                WINDOWS = new Dictionary <string, PreferencesDetachWindow>();
            }
            if (WINDOWS.ContainsKey(editor.GetName()))
            {
                if (WINDOWS[editor.GetName()] != null)
                {
                    WINDOWS[editor.GetName()].Close();
                }

                WINDOWS.Remove(editor.GetName());
            }

            PreferencesDetachWindow window = EditorWindow.GetWindow <PreferencesDetachWindow>(
                editor.GetName(),
                true
                ) as PreferencesDetachWindow;

            WINDOWS.Add(editor.GetName(), window);
            window.editor = editor;
            window.Show();
        }
Esempio n. 2
0
        // INITIALIZERS: --------------------------------------------------------------------------

        public static void Create(IDatabaseEditor editor)
        {
            if (WINDOWS == null)
            {
                WINDOWS = new Dictionary <string, PreferencesDetachWindow>();
            }
            if (WINDOWS.ContainsKey(editor.GetName()))
            {
                if (WINDOWS[editor.GetName()] != null)
                {
                    WINDOWS[editor.GetName()].Close();
                }

                WINDOWS.Remove(editor.GetName());
            }

            string name = editor.GetName();
            PreferencesDetachWindow window = CreateInstance <PreferencesDetachWindow>();

            window.titleContent = new GUIContent(name);

            WINDOWS.Add(name, window);
            window.editor = editor;
            window.Show();
            window.Focus();
        }
Esempio n. 3
0
        private void PaintToolbar(int currentSidebarIndex)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
            GUILayout.FlexibleSpace();

            if (DATABASES[currentSidebarIndex].dataEditor.CanBeDecoupled())
            {
                if (GUILayout.Button("Detach", EditorStyles.toolbarButton))
                {
                    PreferencesDetachWindow.Create(DATABASES[currentSidebarIndex].dataEditor);
                }
            }

            if (GUILayout.Button("Documentation", EditorStyles.toolbarButton))
            {
                Application.OpenURL(DATABASES[currentSidebarIndex].dataEditor.GetDocumentationURL());
            }

            EditorGUILayout.EndHorizontal();
        }