public void Resize() { float sizeTitle = TitleText.rectTransform.sizeDelta.y; float sizeDescr = DescriptionText.rectTransform.sizeDelta.y; float totalSize = sizeTitle + sizeDescr; Vector2 rectSize = new Vector2(TitleText.rectTransform.sizeDelta.x, totalSize); Button.Resize(rectSize); }