Example #1
0
        public InputField AddInputField(InputFieldData inputFieldData)
        {
            var inputField = UserInterface.Instance.CreateInputField(inputFieldData);

            inputField.transform.SetParent(this.inputs);

            return(inputField);
        }
Example #2
0
        public InputField CreateInputField(InputFieldData inputFieldData)
        {
            var inputField = Instantiate(this.inputFieldPrefab, this.canvas.transform, false);

            if (inputFieldData.onValueChanged != null)
            {
                inputField.onValueChanged.AddListener(inputFieldData.onValueChanged);
            }

            if (inputFieldData.onEndEdit != null)
            {
                inputField.onEndEdit.AddListener(inputFieldData.onEndEdit);
            }

            return(inputField);
        }