Ejemplo n.º 1
0
        public void StringTextbox(ref JSONStorableString output, string name, string start,
                                  JSONStorableString.SetStringCallback callback, bool right = false)
        {
            output = new JSONStorableString(name, start, callback);

            script.RegisterString(output);
            var textfield = script.CreateTextField(output, right);
            var input     = textfield.gameObject.AddComponent <InputField>();

            input.textComponent       = textfield.UItext;
            textfield.backgroundColor = Color.white;
            output.inputField         = input;
        }
Ejemplo n.º 2
0
        public JSONStorableString CreateTextField(string paramName, string startingValue, float height, JSONStorableString.SetStringCallback callback, bool rightSide = false)
        {
            var storable      = new JSONStorableString(paramName, startingValue, callback);
            var textField     = UIManager.CreateTextField(storable, rightSide);
            var layoutElement = textField.gameObject.GetComponent <LayoutElement>();

            layoutElement.minHeight       = height;
            layoutElement.preferredHeight = height;

            return(storable);
        }
Ejemplo n.º 3
0
        public JSONStorableString CreateTextField(string paramName, string startingValue, float height, JSONStorableString.SetStringCallback callback, bool canInput = false, bool rightSide = false)
        {
            var storable  = new JSONStorableString(paramName, startingValue, callback);
            var textField = Plugin.CreateTextField(storable, rightSide);

            textField.height = height;

            if (canInput)
            {
                var input = textField.gameObject.AddComponent <InputField>();
                input.textComponent = textField.UItext;
                input.lineType      = InputField.LineType.SingleLine;
                storable.inputField = input;
            }

            return(storable);
        }
Ejemplo n.º 4
0
 public JSONStorableString CreateTextField(string paramName, string startingValue, float height, JSONStorableString.SetStringCallback callback, bool canInput = false, bool rightSide = false)
 {
     var storable = _builder.CreateTextField(paramName, startingValue, height, callback, canInput, rightSide);
     _objects.Add(storable);
     return storable;
 }