Assets/2021-Data-Seth/_PoiyomiShaders/Scripts/ThryEditor/Editor/GUIHelper.cs
/// <summary>
/// Draws extra buttons in the header
/// </summary>
/// <param name="rect"></param>
/// <param name="options"></param>
/// <param name="e"></param>
/// <param name="style"></param>
Draws extra buttons in the header
Draws extra buttons in the header
private void DrawButton(Rect rect, PropertyOptions options, Event e, GUIStyle style)
        {
            if (options.button_right != null && options.button_right.condition_show.Test())
            {
                Rect buttonRect = new Rect(rect);
                GUIContent buttoncontent = new GUIContent(options.button_right.text, options.button_right.hover);
                float width = Styles.dropDownHeaderButton.CalcSize(buttoncontent).x;
                width = width < rect.width / 3 ? rect.width / 3 : width;
                buttonRect.x += buttonRect.width - width - 50;
                buttonRect.y += 2;
                buttonRect.width = width;
                if (GUI.Button(buttonRect, buttoncontent, Styles.dropDownHeaderButton))
                {
                    e.Use();
                    if (options.button_right.action != null)
                        options.button_right.action.Perform();
                }
                EditorGUIUtility.AddCursorRect(buttonRect, MouseCursor.Link);
            }
        }
private void DrawButton ( Rect rect , PropertyOptions options , Event e , GUIStyle style ) { if ( options . button_right != null && options . button_right . condition_show . Test ( ) ) { Rect buttonRect = new Rect ( rect ) ; GUIContent buttoncontent = new GUIContent ( options . button_right . text , options . button_right . hover ) ; float width = Styles . dropDownHeaderButton . CalcSize ( buttoncontent ) . x ; width = width < rect . width / 3 ? rect . width / 3 : width ; buttonRect . x += buttonRect . width - width - 50 ; buttonRect . y += 2 ; buttonRect . width = width ; if ( GUI . Button ( buttonRect , buttoncontent , Styles . dropDownHeaderButton ) ) { e . Use ( ) ; if ( options . button_right . action != null ) options . button_right . action . Perform ( ) ; } EditorGUIUtility . AddCursorRect ( buttonRect , MouseCursor . Link ) ; } }
Draws extra buttons in the header
Draws extra buttons in the header
rect
Rect
None
options
PropertyOptions
None
e
Event
None
style
GUIStyle
None