본문 바로가기

Programming/유니티

UGUI - text 글자길이에 맞게 Recttransform 크기 변경하기 (recttransform resize as text length)


Recttransform m_Text_Recttransform;
Text m_Text;

m_Text.string = "asfsafsdfasdfsa";
m_Text_Recttransfrom.sizeDelta = new Vector2 (m_Text.preferredWith, m_Text.preferredHeight);