private static float CalcMinWidth(GUIStyle style, string str, float redundant = 0) { float min, max; style.CalcMinMaxWidth(GUIContents.Temp1(str), out min, out max); return(min + redundant); }
private static Vector2 CalcMinSize( GUIStyle style, string str, float redundantWidth = 0, float redundantHeight = 0) { var size = style.CalcSize(GUIContents.Temp1(str)); size.x += redundantWidth; size.y += redundantHeight; return(size); }
public static bool ImageButton(Texture2D image, float width, float height) { var rect = GUILayoutUtility.GetRect(width, height, GUILayout.Width(width), GUILayout.Height(height)); return(GUI.Button(rect, GUIContents.Temp1(image), EditorStylesEx.ImageButton)); }