Skip to content

Commit 1a31cbb

Browse files
committed
Documentation feedback and fixed a test validation failure
1 parent 9a5efa3 commit 1a31cbb

File tree

1 file changed

+10
-10
lines changed
  • Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput

1 file changed

+10
-10
lines changed

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/InputValue.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ public object Get()
4040
/// </summary>
4141
/// <returns>The current value from the action cast to the specified type.</returns>
4242
/// <typeparam name="TValue">Type of value to read. This must correspond to the
43-
/// expected by either <see cref="control"/> or, if it is a composite, by the
44-
/// <see cref="InputBindingComposite"/> in use.
45-
/// The type depends on what type of controls the action is bound to. Common types are <c>float</c> and <see cref="UnityEngine.Vector2"/></typeparam>
43+
/// <see cref="InputControl.valueType"/> of the action or, if it is a composite, by the
44+
/// <see cref="InputBindingComposite.valueType"/>.
45+
/// The type depends on what type of controls the action is bound to.
46+
/// Common types are <c>float</c> and <see cref="UnityEngine.Vector2"/></typeparam>
4647
/// <exception cref="InvalidOperationException">The given type <typeparamref name="TValue"/>
4748
/// does not match the value type expected by the control or binding composite.</exception>
4849
/// <remarks>
@@ -62,7 +63,7 @@ public object Get()
6263
/// m_Move = value.Get&lt;Vector2&gt;();
6364
/// }
6465
///
65-
/// public void OnUpdate()
66+
/// public void Update()
6667
/// {
6768
/// // Update transform from m_Move
6869
/// }
@@ -87,24 +88,23 @@ public TValue Get<TValue>()
8788
/// </summary>
8889
/// <returns>True if the button is activated over the button threshold. False otherwise</returns>
8990
/// <remarks>
90-
/// The following example shows how to read a value from a <see cref="PlayerInput"/> message.
91+
/// The following example check if a button is pressed when receiving a <see cref="PlayerInput"/> message.
9192
///
9293
/// <example>
9394
/// <code>
9495
/// [RequireComponent(typeof(PlayerInput))]
9596
/// public class MyPlayerLogic : MonoBehaviour
9697
/// {
97-
/// private bool m_Fire;
98-
///
9998
/// // 'Fire' input action has been triggered.
10099
/// public void OnFire(InputValue value)
101100
/// {
102-
/// m_Fire = value.isPressed;
101+
/// if (value.isPressed)
102+
/// FireWeapon();
103103
/// }
104104
///
105-
/// public void OnUpdate()
105+
/// public void FireWeapon()
106106
/// {
107-
/// // Perform fire action if m_Fire is true
107+
/// // Weapon firing code
108108
/// }
109109
/// }
110110
/// </code>

0 commit comments

Comments
 (0)