UnityEngine.UI.DefaultControls.CreateInputField C# (CSharp) Method

CreateInputField() public static method

public static CreateInputField ( Resources resources ) : GameObject
resources UnityEngine.Resources
return UnityEngine.GameObject
        public static GameObject CreateInputField(Resources resources)
        {
            GameObject parent = CreateUIElementRoot("InputField", s_ThickElementSize);
            GameObject obj3 = CreateUIObject("Placeholder", parent);
            GameObject obj4 = CreateUIObject("Text", parent);
            Image image = parent.AddComponent<Image>();
            image.sprite = resources.inputField;
            image.type = Image.Type.Sliced;
            image.color = s_DefaultSelectableColor;
            InputField slider = parent.AddComponent<InputField>();
            SetDefaultColorTransitionValues(slider);
            Text lbl = obj4.AddComponent<Text>();
            lbl.text = "";
            lbl.supportRichText = false;
            SetDefaultTextValues(lbl);
            Text text2 = obj3.AddComponent<Text>();
            text2.text = "Enter text...";
            text2.fontStyle = FontStyle.Italic;
            Color color = lbl.color;
            color.a *= 0.5f;
            text2.color = color;
            RectTransform component = obj4.GetComponent<RectTransform>();
            component.anchorMin = Vector2.zero;
            component.anchorMax = Vector2.one;
            component.sizeDelta = Vector2.zero;
            component.offsetMin = new Vector2(10f, 6f);
            component.offsetMax = new Vector2(-10f, -7f);
            RectTransform transform2 = obj3.GetComponent<RectTransform>();
            transform2.anchorMin = Vector2.zero;
            transform2.anchorMax = Vector2.one;
            transform2.sizeDelta = Vector2.zero;
            transform2.offsetMin = new Vector2(10f, 6f);
            transform2.offsetMax = new Vector2(-10f, -7f);
            slider.textComponent = lbl;
            slider.placeholder = text2;
            return parent;
        }