public Input(string text, Font font, Point point, string type, int size, string value) : this() { InputBox = CreateInputBox(type, text, size, value); InputBox.Font = font; InputBox.Location = point; InputBox.Tag = type; }
private void Start() { if (isLocalPlayer) { InitPlayerLocaly(); CmdSpawnAvatar(avatarData.name); userControlInput = GetComponent <UserControlInput>(); } }
private UserControlInput CreateInputBox(string type, string name, int size, string value) { UserControlInput _input = null; switch (type) { case "FILE_SELECT": _input = new InputFile(); ((InputFile)_input).Name = name; ((InputFile)_input).Text = value; break; case "SELECT": _input = new InputSelection(); ((InputSelection)_input).Name = name; ((InputSelection)_input).Text = value; break; case "DEC": _input = new InputDecimal(); ((InputDecimal)_input).Minimum = 0; ((InputDecimal)_input).Maximum = size; ((InputDecimal)_input).Name = name; ((InputDecimal)_input).Text = value; break; case "HEX": _input = new InputHexadecimal(); ((InputHexadecimal)_input).MaxLength = size; ((InputHexadecimal)_input).Name = name; ((InputHexadecimal)_input).Text = value; break; case "ASCII": _input = new InputString(); ((InputString)_input).MaxLength = size; ((InputString)_input).Name = name; ((InputString)_input).Text = value; break; default: throw new Exception(); } return(_input); }