示例#1
0
        private void GUITopBar()
        {
            //if header is texture, draw it first so other ui elements can be positions below
            if (_shaderHeader != null && _shaderHeader.Options.texture != null)
            {
                _shaderHeader.Draw();
            }

            bool drawAboveToolbar = EditorGUIUtility.wideMode == false;

            if (drawAboveToolbar)
            {
                _shaderHeader.Draw(new CRect(EditorGUILayout.GetControlRect()));
            }

            Rect mainHeaderRect = EditorGUILayout.BeginHorizontal();

            //draw editor settings button
            if (GuiHelper.ButtonWithCursor(Styles.icon_style_settings, "Settings", 25, 25))
            {
                EditorWindow.GetWindow <Settings>(false, "Thry Settings", true);
            }
            if (GuiHelper.ButtonWithCursor(Styles.icon_style_search, "Search", 25, 25))
            {
                DoShowSearchBar = !DoShowSearchBar;
                if (!DoShowSearchBar)
                {
                    ClearSearch();
                }
            }
            Presets.PresetGUI(this);

            //draw master label text after ui elements, so it can be positioned between
            if (_shaderHeader != null && !drawAboveToolbar)
            {
                _shaderHeader.Draw(new CRect(mainHeaderRect));
            }

            GUILayout.FlexibleSpace();
            Rect popupPosition;

            if (GuiHelper.ButtonWithCursor(Styles.icon_style_tools, "Tools", 25, 25, out popupPosition))
            {
                PopupTools(popupPosition);
            }
            ShaderTranslator.TranslationSelectionGUI(this);
            if (GuiHelper.ButtonWithCursor(Styles.icon_style_thryIcon, "Thryrallo", 25, 25))
            {
                Application.OpenURL("https://www.twitter.com/thryrallo");
            }
            EditorGUILayout.EndHorizontal();
        }
示例#2
0
        private void GUITopBar()
        {
            //if header is texture, draw it first so other ui elements can be positions below
            if (shaderHeader != null && shaderHeader.options.texture != null)
            {
                shaderHeader.Draw();
            }
            Rect mainHeaderRect = EditorGUILayout.BeginHorizontal();

            //draw editor settings button
            if (GuiHelper.ButtonWithCursor(Styles.icon_style_settings, 25, 25))
            {
                Thry.Settings window = Thry.Settings.getInstance();
                window.Show();
                window.Focus();
            }
            if (GuiHelper.ButtonWithCursor(Styles.icon_style_search, 25, 25))
            {
                show_search_bar = !show_search_bar;
                if (!show_search_bar)
                {
                    ClearSearch();
                }
            }
            Rect presetR = GUILayoutUtility.GetRect(25, 25);

            Presets.PresetGUI(presetR, this);

            //draw master label text after ui elements, so it can be positioned between
            if (shaderHeader != null)
            {
                shaderHeader.Draw(new CRect(mainHeaderRect));
            }

            //GUILayout.Label("Thryrallo",GUILayout.ExpandWidth(true));
            GUILayout.FlexibleSpace();
            GUILayout.Label("@UI by Thryrallo", Styles.made_by_style, GUILayout.Height(25), GUILayout.MaxWidth(100));
            EditorGUILayout.EndHorizontal();
        }