Skip to content

Commit 5fe1547

Browse files
committed
Documented WriteValueIntoState
1 parent 34cfaf6 commit 5fe1547

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ public virtual unsafe void WriteValueFromBufferIntoState(void* bufferPtr, int bu
596596
/// </summary>
597597
/// <param name="value">Value for the control to store in the state.</param>
598598
/// <param name="statePtr">State containing the control's <see cref="stateBlock"/>. Will receive
599-
/// the state state as converted from the given value.</param>
599+
/// the state as converted from the given value.</param>
600600
/// <remarks>
601601
/// Writing values will NOT apply processors to the given value. This can mean that when reading a value
602602
/// from a control after it has been written to its state, the resulting value differs from what was
@@ -1342,7 +1342,7 @@ public abstract class InputControl<TValue> : InputControl
13421342
///
13431343
/// Also note that this property returns the result as ref readonly. If custom control states are in use, i.e.
13441344
/// any controls not shipped with the Input System package, be careful of accidental defensive copies
1345-
/// <see href="https://docs.microsoft.com/en-us/dotnet/csharp/write-safe-efficient-code#avoid-defensive-copies"/>.
1345+
/// <a href="https://docs.microsoft.com/en-us/dotnet/csharp/write-safe-efficient-code#avoid-defensive-copies">https://docs.microsoft.com/en-us/dotnet/csharp/write-safe-efficient-code#avoid-defensive-copies</a>.
13461346
/// </remarks>
13471347
/// <seealso cref="ReadValue"/>
13481348
public ref readonly TValue value
@@ -1634,7 +1634,20 @@ public override unsafe void WriteValueFromObjectIntoState(object value, void* st
16341634
WriteValueIntoState(valueOfType, statePtr);
16351635
}
16361636

1637-
/// <inheritdoc />
1637+
/// <summary>
1638+
/// Write a value into state at the given memory.
1639+
/// </summary>
1640+
/// <param name="value">Value for the control to store in the state.</param>
1641+
/// <param name="statePtr">State containing the control's <see cref="InputControl.stateBlock"/>. Will receive
1642+
/// the state as converted from the given value.</param>
1643+
/// <remarks>
1644+
/// Writing values will NOT apply processors to the given value. This can mean that when reading a value
1645+
/// from a control after it has been written to its state, the resulting value differs from what was
1646+
/// written.
1647+
/// </remarks>
1648+
/// <exception cref="NotSupportedException">The control does not support writing. This is the case, for
1649+
/// example, that compute values (such as the magnitude of a vector).</exception>
1650+
/// <seealso cref="WriteValueFromBufferIntoState"/>
16381651
public virtual unsafe void WriteValueIntoState(TValue value, void* statePtr)
16391652
{
16401653
////REVIEW: should we be able to even tell from layouts which controls support writing and which don't?

0 commit comments

Comments
 (0)