A game about forced loneliness, made by TACStudios
at master 546 B view raw
1using System; 2 3using UnityEngine; 4 5namespace Unity.PlasticSCM.Editor.UI 6{ 7 internal static class MeasureMaxWidth 8 { 9 internal static float ForTexts(GUIStyle style, params string[] texts) 10 { 11 float result = 0; 12 13 GUIContent content = new GUIContent(); 14 15 foreach (string text in texts) 16 { 17 content.text = text; 18 19 result = Math.Max(result, 20 style.CalcSize(content).x); 21 } 22 23 return result + 10; 24 } 25 } 26}