private void ResizeBubble() { float effectiveBubbleHeight = bubbleHeight != -1 ? bubbleHeight < 16 ? 40 : bubbleHeight + 24 : UnitaleUtil.CalcTotalHeight(this) < 16 ? 40 : UnitaleUtil.CalcTotalHeight(this) + 24; containerBubble.transform.GetComponent <RectTransform>().sizeDelta = new Vector2(textWidth + 20, effectiveBubbleHeight); //To set the borders UnitaleUtil.GetChildPerName(containerBubble.transform, "BackHorz").GetComponent <RectTransform>().sizeDelta = new Vector2(textWidth + 20, effectiveBubbleHeight - 20 * 2); //BackHorz UnitaleUtil.GetChildPerName(containerBubble.transform, "BackVert").GetComponent <RectTransform>().sizeDelta = new Vector2(textWidth - 20, effectiveBubbleHeight); //BackVert UnitaleUtil.GetChildPerName(containerBubble.transform, "CenterHorz").GetComponent <RectTransform>().sizeDelta = new Vector2(textWidth + 16, effectiveBubbleHeight - 16 * 2); //CenterHorz UnitaleUtil.GetChildPerName(containerBubble.transform, "CenterVert").GetComponent <RectTransform>().sizeDelta = new Vector2(textWidth - 16, effectiveBubbleHeight - 4); //CenterVert SetSpeechThingPositionAndSide(bubbleSide.ToString(), bubbleLastVar); }