Example #1
0
 public void SetText(string text)
 {
     if (autoSize)
     {
         Vector2 bodySize = target.GetTMPRequiredSize(text, new Vector2(1200, 1200));
         bodySize.x += padding.Horizontal;
         bodySize.y += padding.Vertical;
         GetComponent <RectTransform>().sizeDelta = bodySize;
     }
     else
     {
         target.text = text;
     }
 }