Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

InputField.lineType

Switch to Manual
public var lineType: UI.InputField.LineType;

Description

The LineType used by the InputField.

#pragma strict
// Required when Using UI elements.
public class Example {
	public var mainInputField;
	//When you press a button, this method is called.
	public function ChangeInputField(type) {
		if (type == 0) {
			//Change the input field to "Single Line" line type.
			mainInputField.GetComponent.<InputField>().lineType = InputField.LineType.SingleLine;
		}
		elseif (type == 1) {
			//Change the input field to "MultiLine Newline" line type.
			mainInputField.GetComponent.<InputField>().lineType = InputField.LineType.MultiLineNewline;
		}
		elseif (type == 2) {
			//Change the input field to "MultiLine Submit" line type.
			mainInputField.GetComponent.<InputField>().lineType = InputField.LineType.MultiLineSubmit;
		}
	}
}