public static GameObject CreateText(Resources resources) { GameObject obj2 = CreateUIElementRoot("Text", s_ThickElementSize); Text lbl = obj2.AddComponent<Text>(); lbl.text = "New Text"; SetDefaultTextValues(lbl); return obj2; }