Firstborn/Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/UI/DrawActionButton.cs
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

44 lines
1.2 KiB
C#

using UnityEditor;
using UnityEngine;
namespace Unity.PlasticSCM.Editor.UI
{
internal static class DrawActionButton
{
internal static bool For(string buttonText)
{
GUIContent buttonContent = new GUIContent(buttonText);
GUIStyle buttonStyle = new GUIStyle(EditorStyles.miniButton);
buttonStyle.stretchWidth = false;
Rect rt = GUILayoutUtility.GetRect(
buttonContent,
buttonStyle,
GUILayout.MinWidth(UnityConstants.REGULAR_BUTTON_WIDTH));
return GUI.Button(rt, buttonText, buttonStyle);
}
internal static bool ForCommentSection(string buttonText)
{
GUIContent buttonContent = new GUIContent(buttonText);
GUIStyle buttonStyle = new GUIStyle(EditorStyles.miniButton);
buttonStyle.stretchWidth = false;
var width = MeasureMaxWidth.ForTexts(buttonStyle, buttonText);
Rect rt = GUILayoutUtility.GetRect(
buttonContent,
buttonStyle,
GUILayout.MinWidth(width),
GUILayout.MaxWidth(width));
return GUI.Button(rt, buttonText, buttonStyle);
}
}
}