public static GameObject CreateButton(DefaultControls.Resources resources)
{
GameObject gameObject = DefaultControls.CreateUIElementRoot("Button", DefaultControls.s_ThickElementSize);
GameObject gameObject2 = new GameObject("Text");
gameObject2.AddComponent <RectTransform>();
DefaultControls.SetParentAndAlign(gameObject2, gameObject);
Image image = gameObject.AddComponent <Image>();
image.sprite = resources.standard;
image.type = Image.Type.Sliced;
image.color = DefaultControls.s_DefaultSelectableColor;
Button defaultColorTransitionValues = gameObject.AddComponent <Button>();
DefaultControls.SetDefaultColorTransitionValues(defaultColorTransitionValues);
Text text = gameObject2.AddComponent <Text>();
text.text = "Button";
text.alignment = TextAnchor.MiddleCenter;
DefaultControls.SetDefaultTextValues(text);
RectTransform component = gameObject2.GetComponent <RectTransform>();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.sizeDelta = Vector2.zero;
return(gameObject);
}