示例#1
0
 private void DrawLinkSettings(Rect rect, Event e)
 {
     if (GuiHelper.Button(rect, Styles.icon_style_linked, Styles.COLOR_ICON_ACTIVE_CYAN, MaterialLinker.IsLinked(ShaderEditor.active.currentProperty.materialProperty)))
     {
         ShaderEditor.input.Use();
         List <Material> linked_materials = MaterialLinker.GetLinked(ShaderEditor.active.currentProperty.materialProperty);
         MaterialLinker.Popup(rect, linked_materials, ShaderEditor.active.currentProperty.materialProperty);
     }
 }
示例#2
0
        public static bool Button(GUIStyle style, int width, int height, Color c)
        {
            Color prevColor = GUI.backgroundColor;

            GUI.backgroundColor = c;
            bool b = GuiHelper.Button(style, width, height);

            GUI.backgroundColor = prevColor;
            return(b);
        }
示例#3
0
        public static bool Button(Rect r, string tooltip, GUIStyle style, Color c)
        {
            Color prevColor = GUI.backgroundColor;

            GUI.backgroundColor = c;
            bool b = GuiHelper.Button(r, tooltip, style);

            GUI.backgroundColor = prevColor;
            return(b);
        }
示例#4
0
        public static bool Button(Rect r, GUIStyle style, Color c, bool doColor)
        {
            Color prevColor = GUI.backgroundColor;

            if (doColor)
            {
                GUI.backgroundColor = c;
            }
            bool b = GuiHelper.Button(r, style);

            GUI.backgroundColor = prevColor;
            return(b);
        }
示例#5
0
        private void DrawDowdownSettings(Rect rect, Event e)
        {
            if (GuiHelper.Button(rect, Styles.icon_style_menu))
            {
                ShaderEditor.input.Use();
                Rect buttonRect = new Rect(rect);
                buttonRect.width  = 150;
                buttonRect.x      = Mathf.Min(Screen.width - buttonRect.width, buttonRect.x);
                buttonRect.height = 60;
                float maxY = GUIUtility.ScreenToGUIPoint(new Vector2(0, EditorWindow.focusedWindow.position.y + Screen.height)).y - 2.5f * buttonRect.height;
                buttonRect.y = Mathf.Min(buttonRect.y - buttonRect.height / 2, maxY);

                ShowHeaderContextMenu(buttonRect, ShaderEditor.active.currentProperty, ShaderEditor.active.materials[0]);
            }
        }
示例#6
0
        private void DrawHelpButton(Rect rect, PropertyOptions options, Event e)
        {
            ButtonData button = this.button != null ? this.button : options.button_help;

            if (button != null && button.condition_show.Test())
            {
                if (GuiHelper.Button(rect, Styles.icon_style_help))
                {
                    ShaderEditor.input.Use();
                    if (button.action != null)
                    {
                        button.action.Perform();
                    }
                }
            }
        }