Skip to content

Commit 6d582c2

Browse files
committed
page rename and intro text to control optimization
1 parent 5eabba5 commit 6d582c2

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

Packages/com.unity.inputsystem/Documentation~/action-and-control-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Actions have an **Action Type** and **Control Type** which you can configure in
1010
| **[Configure control type](./configure-control-type.md.md)** | Select the type of control expected by the action. |
1111

1212
## Additional resources
13-
[Control types reference](./control-types.md)
13+
[Control types reference](control-types-reference.md)

Packages/com.unity.inputsystem/Documentation~/binding-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ When you [add a binding](add-duplicate-delete-binding.md) you must select the ap
99

1010
Some examples of composite bindings are:
1111

12-
- A **four-way** composite binding, where four keyboard keys map to an action whose [control type](control-types.md) is a 2D vector, so that each of the keys maps to up, down, left, and right respectively. In this scenario, the four key bindings are simple bindings grouped together into into the composite four-way binding.
12+
- A **four-way** composite binding, where four keyboard keys map to an action whose [control type](control-types-reference.md) is a 2D vector, so that each of the keys maps to up, down, left, and right respectively. In this scenario, the four key bindings are simple bindings grouped together into into the composite four-way binding.
1313

1414
- A **modifier** composite binding, where one control represents the main binding, and a second control represents a modifier key which changes the effect of the main binding - such as holding down the control key on a keyboard before also pressing a letter key. In this scenario, the two separate key bindings are simple bindings grouped together into the composite modifier binding.
1515

Packages/com.unity.inputsystem/Documentation~/composite-bindings-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The **Add binding (+)** menu contains the following options.
1616
| **Add Positive/Negative Binding** | Adds a 1D axis composite binding made of two button sub-bindings, one that pulls a 1D axis in its negative direction, and another that pulls it in its positive direction. It is implemented in the [`AxisComposite`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html) class. The output is a `float`.<br/><br/>If Controls from both the `positive` and the `negative` side are actuated, then the resulting value of the axis Composite depends on the **Which side wins** [binding property](./binding-properties-panel.md). |
1717
| **Add Up/Down/Left/Right Composite** | Adds a 2D axis composite binding that represents a 4-way button control like the D-pad on gamepads. Each button sub-binding represents a cardinal direction, is most useful for representing up-down-left-right controls, such as WASD keyboard input. It is implemented in the [`Vector2Composite`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html) class. The output is a `Vector2`. This composite's [**mode** property](./binding-properties-panel.md) allows you to choose whether the inputs should be treated as digital or analog controls. |
1818
| **Add Up/Down/Left/Right/Forward/Backward Composite** | Adds a 3D composite binding that represents a 6-way button where two combinations each control one axis of a 3D vector. Implemented in the [`Vector3Composite`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html) class. The output is a `Vector3`. <br/><br/> This composite's [**mode** property](./binding-properties-panel.md) allows you to choose whether the inputs should be treated as digital or analog controls. |
19-
| **Add Binding With One Modifier** | Adds a composite with two sub-bindings, named **Binding** and **Modifier**, which requires the user to hold down the **modifier** button in addition to another control from which the actual value of the binding is determined. This can be used, for example, for bindings such as "SHIFT+1". Implemented in the [`OneModifierComposite`](../api/UnityEngine.InputSystem.Composites.OneModifierComposite.html) class. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.<br/><br/>The output is a [value of the same type](control-types.md) as the control bound to the sub-binding named **Binding**. |
20-
| **Add Binding With Two Modifiers** | Adds a composite with three sub-bindings, named **Binding**, **Modifier 1** and **Modifier 2**, which requires the user to hold down two modifier buttons in addition to another control from which the actual value of the binding is determined. This can be used, for example, for bindings such as "SHIFT+CTRL+1". Implemented in the [`TwoModifiersComposite`](../api/UnityEngine.InputSystem.Composites.TwoModifiersComposite.html) class. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.<br/><br/>The output is a [value of the same type](control-types.md) as the control bound to the sub-binding named **Binding**. |
19+
| **Add Binding With One Modifier** | Adds a composite with two sub-bindings, named **Binding** and **Modifier**, which requires the user to hold down the **modifier** button in addition to another control from which the actual value of the binding is determined. This can be used, for example, for bindings such as "SHIFT+1". Implemented in the [`OneModifierComposite`](../api/UnityEngine.InputSystem.Composites.OneModifierComposite.html) class. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.<br/><br/>The output is a [value of the same type](control-types-reference.md) as the control bound to the sub-binding named **Binding**. |
20+
| **Add Binding With Two Modifiers** | Adds a composite with three sub-bindings, named **Binding**, **Modifier 1** and **Modifier 2**, which requires the user to hold down two modifier buttons in addition to another control from which the actual value of the binding is determined. This can be used, for example, for bindings such as "SHIFT+CTRL+1". Implemented in the [`TwoModifiersComposite`](../api/UnityEngine.InputSystem.Composites.TwoModifiersComposite.html) class. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.<br/><br/>The output is a [value of the same type](control-types-reference.md) as the control bound to the sub-binding named **Binding**. |
2121

2222
> **Note**: You can also [create custom composite bindings from code](./create-custom-composite-binding.md)

Packages/com.unity.inputsystem/Documentation~/configure-control-type.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Configure Control type
33

4-
The **Control Type** setting allows you to select the type of control expected by the action. This limits the types of [composite bindings](composite-bindings-reference.md) and [control types](control-types.md) shown when setting up bindings in the UI, and also limits which controls can be bound interactively to the action. This makes it simpler to select appropriate options when setting up bindings.
4+
The **Control Type** setting allows you to select the type of control expected by the action. This limits the types of [composite bindings](composite-bindings-reference.md) and [control types](control-types-reference.md) shown when setting up bindings in the UI, and also limits which controls can be bound interactively to the action. This makes it simpler to select appropriate options when setting up bindings.
55

66
Configuring an action's **Control Type** is typically done when you create a new action, however you can also change the control type of an existing action.
77

@@ -12,5 +12,5 @@ To configure an action's action type:
1212
3. Select the action type from the available [action type options](action-type-reference.md).
1313

1414
## Additional resources
15-
[Control types reference](./control-types.md)
15+
[Control types reference](control-types-reference.md)
1616

Packages/com.unity.inputsystem/Documentation~/controls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A **control** is a part of a [device](devices.md) that sends values to the Input
1212
| :------------------------------ | :------------------------------- |
1313
| **[About controls](about-controls.md)** | An introduction to the concept of controls. |
1414
| **[Control hierarchies](control-hierarchies.md)** | Summary |
15-
| **[Control types](control-types.md)** | Summary |
15+
| **[Control types](control-types-reference.md)** | Summary |
1616
| **[Control usages](control-usages.md)** | Summary |
1717
| **[Control paths](control-paths.md)** | Summary |
1818
| **[Control state](control-state.md)** | Summary |

Packages/com.unity.inputsystem/Documentation~/optimize-controls.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Optimizing controls
22

3+
The [recommended workflow](Workflows.md) is sufficiently optimized for most scenarios. However in some specialized situations when reading values directly from controls, you can make small performance gains by implementing some of the following techniques.
4+
35
## Avoiding defensive copies
46

57
Use [`InputControl<T>.value`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_value) instead of [`InputControl<T>.ReadValue`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_ReadValue) to avoid creating a copy of the control state on every call, as the former returns the value as `ref readonly` while the latter always makes a copy. Note that this optimization only applies if the call site assigns the return value to a variable that has been declared 'ref readonly'. Otherwise a copy will be made as before. Additionally, be aware of defensive copies that can be allocated by the compiler when it is unable to determine that it can safely use the readonly reference i.e. if it can't determine that the reference won't be changed, it will create a defensive copy for you. For more details, see https://learn.microsoft.com/en-us/dotnet/csharp/write-safe-efficient-code#use-ref-readonly-return-statements.

Packages/com.unity.inputsystem/Documentation~/select-control-binding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To select the control path for a binding from a list of available controls:
3030

3131
![Control Picker](Images/InputControlPicker.png)
3232

33-
Unity filters this list by the Action's [`Control Type`](./control-types.md) property. For example, if the Control type is `Vector2`, you can only select a Control that generates two-dimensional values, like a stick.
33+
Unity filters this list by the Action's [`Control Type`](control-types-reference.md) property. For example, if the Control type is `Vector2`, you can only select a Control that generates two-dimensional values, like a stick.
3434

3535
In this list, use the **Usages** section to [select a control by usage](./control-usages.md) (such as `Back`), rather than by physical endpoint (such as `Button South`).
3636

0 commit comments

Comments
 (0)