Build a layout programmatically. Primarily for use by layout builders
registered with the system.
Inheritance
InputControlLayout.Builder
Properties
List of control items set up by the layout.
Declaration
public ReadOnlyArray<InputControlLayout.ControlItem> controls { get; }
Property Value
Display name to assign to the layout.
Declaration
public string displayName { get; set; }
Property Value
Type |
Description |
String |
Display name to assign to the layout
|
Which layout to base this layout on.
Declaration
public string extendsLayout { get; set; }
Property Value
Type |
Description |
String |
Name of base layout.
|
Name to assign to the layout.
Declaration
public string name { get; set; }
Property Value
Type |
Description |
String |
Name to assign to the layout.
|
Memory format FourCC code to apply to state memory used by the
layout.
Declaration
public FourCC stateFormat { get; set; }
Property Value
Type |
Description |
FourCC |
FourCC memory format tag.
|
Total size of memory used by the layout.
Declaration
public int stateSizeInBytes { get; set; }
Property Value
Type |
Description |
Int32 |
Size of memory used by the layout.
|
Declaration
public Type type { get; set; }
Property Value
Type |
Description |
Type |
Control type to instantiate for the layout.
|
For device layouts, whether the device wants an extra update
before rendering.
Declaration
public bool? updateBeforeRender { get; set; }
Property Value
Type |
Description |
Nullable<Boolean> |
True if before-render updates should be enabled for the device.
|
Methods
Add a new control to the layout.
Declaration
public InputControlLayout.Builder.ControlBuilder AddControl(string name)
Parameters
Type |
Name |
Description |
String |
name |
Name or path of the control. If it is a path (e.g. "leftStick/x" ,
then the control either modifies the setup of a child control of another control in the layout
or adds a new child control to another control in the layout. Modifying child control is useful,
for example, to alter the state format of controls coming from the base layout. Likewise,
adding child controls to another control is useful to modify the setup of of the control layout
being used without having to create and register a custom control layout.
|
Returns
Exceptions
Declaration
public InputControlLayout Build()
Returns
Declaration
public InputControlLayout.Builder Extend(string baseLayoutName)
Parameters
Type |
Name |
Description |
String |
baseLayoutName |
|
Returns
Declaration
public InputControlLayout.Builder WithDisplayName(string displayName)
Parameters
Type |
Name |
Description |
String |
displayName |
|
Returns
Declaration
public InputControlLayout.Builder WithFormat(string format)
Parameters
Type |
Name |
Description |
String |
format |
|
Returns
Declaration
public InputControlLayout.Builder WithFormat(FourCC format)
Parameters
Type |
Name |
Description |
FourCC |
format |
|
Returns
Declaration
public InputControlLayout.Builder WithName(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
Declaration
public InputControlLayout.Builder WithSizeInBytes(int sizeInBytes)
Parameters
Type |
Name |
Description |
Int32 |
sizeInBytes |
|
Returns
Declaration
public InputControlLayout.Builder WithType<T>()
where T : InputControl
Returns
Type Parameters
See Also
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.