privatevoidBubbleFormate() { // MainContent.GraphicUpdateComplete(); if (MainContent.rectTransform.sizeDelta.x > MainContent.preferredWidth) { MainContentBG.rectTransform.sizeDelta = new Vector2( MainContentBG.rectTransform.sizeDelta.x - (MainContent.rectTransform.sizeDelta.x - MainContent.preferredWidth), MainContentBG.rectTransform.sizeDelta.y ); } else { int temp_width = 0; var rawContent = MainContent.text;
for (int i = 0; i < MainContent.text.Length; i++) { MainContent.font.GetCharacterInfo(MainContent.text[i], out temp_info, MainContent.fontSize); temp_width += temp_info.advance;