private static GameObject CreateUIElementRoot(string name, Vector2 size) { GameObject child = new GameObject(name); RectTransform rectTransform = child.AddComponent<RectTransform>(); rectTransform.sizeDelta = size; return child; }